I'm using Pandas to read in a .csv file containing dates and a product type and I'm trying to graph the amount of each product over time. Heres my current code:
df = df.dropna()
df= df[df['product'].str.contains("X|Y|Z")]
df=df.groupby('date')['product'].value_counts()
which returns me this dataframe:
date product
2013.0 X 2229
Y 194
Z 590
2014.0 X 229
Y 1924
Z 5902
Whats the best way to plot this using matplotlib?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.