python - Plotting a Pandas DataSeries.GroupBy -
i new python , pandas, , have following dataframe
.
how can plot dataframe
each modelid
separate plot, saledate
x-axis , meantodate
y-axis?
attempt
data[40:76].groupby('modelid').plot()
dataframe
you can make plots looping on groups groupby
:
import matplotlib.pyplot plt title, group in df.groupby('modelid'): group.plot(x='saledate', y='meantodate', title=title)
see more information on plotting pandas dataframes:
http://pandas.pydata.org/pandas-docs/stable/visualization.html
, looping on groupby-object:
http://pandas.pydata.org/pandas-docs/stable/groupby.html#iterating-through-groups
Comments
Post a Comment