Mar-22-2022, 06:26 PM
Hopefully this isn't too hard to follow.
Fri_2017 is a list of the first 20 Fridays in 2017 as type datetime.datetime .
I also have this:
I also have this line:
Fri_2017 is a list of the first 20 Fridays in 2017 as type datetime.datetime .
I also have this:
for i in range(20): random_pnl_list.append(random.randint(-1000,1000)) cumul_pnl_from_random = list(np.cumsum(random_pnl_list))Now... when I do this in matplotlib:
plt.plot(Fri_2017,cumul_pnl_from_random)I get x-axis labels at the first and 22nd of the first five months (e.g. 2017-01-01, 2017-01-22, 2017-02-01... 2017-05-01, 2017-05-22). How is this determined--both format and those two particular dates of every month?
I also have this line:
converted_Fri_2017 = [d.strftime('%Y-%m-%d') for d in Fri_2017]When I do:
plt.plot(converted_Fri_2017,cumul_pnl_from_random)I get x-axis labels of same format as above (yyyy-mm-dd) but every Friday from 1/6/17 through 5/19/17 (20 total labels). Why the difference?