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

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -