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() 

enter image description here

dataframe

enter image description here

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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -