I have DataFrame in Python Pandas like below:
date_col - in "datetime64" format
sales - in "int64" format
date_col sales 2019-01-05 100 2019-03-20 500 2019-04-28 290 ... ...
And I need to create Time Series plot and mark in a separate color the 5 days with the highest number of sales.
Currently I have code like below:
df['sales'].plot(linewidth=1.5,
grid = True,
marker="o",
linestyle="-",
markersize=4,
label="Daily sales",
color = "steelblue")
plt.xlabel("date")
plt.ylabel("sales")
plt.legend()
plt.show()
But as a final result I need something like below:
- vertical lines representing 5 days with the highest sales
- date in year month day format for those 5 days with the highest sales
How can I do that in Python ? How can I modify my code or do that in other way?
mrCopiCat I used your code and I have result like below, why ?



