擅长:python、mysql、java
<p>您可以通过循环来自<code>groupby</code>的组来生成绘图:</p>
<pre><code>import matplotlib.pyplot as plt
for title, group in df.groupby('ModelID'):
group.plot(x='saleDate', y='MeanToDate', title=title)
</code></pre>
<p>有关使用pandas数据帧绘制的详细信息,请参见:<br/>
<a href="http://pandas.pydata.org/pandas-docs/stable/visualization.html" rel="noreferrer">http://pandas.pydata.org/pandas-docs/stable/visualization.html</a><br/>
对于groupby对象上的循环:<br/>
<a href="http://pandas.pydata.org/pandas-docs/stable/groupby.html#iterating-through-groups" rel="noreferrer">http://pandas.pydata.org/pandas-docs/stable/groupby.html#iterating-through-groups</a></p>