Travel Tips
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
使用Python中的matplotlib库读取csv文件绘制混合图
* Python代码
```python import pandas as pd import matplotlib.pyplot as plt import matplotlib as mpl data = pd.read_csv('taobao_data.csv', index_col='位置') data.drop(['宝贝', '卖家'], inplace=True, axis=1) data = data.groupby(['位置']).mean().sort_values(by='成交量') print(data.head()) fig, axis = plt.subplots(2, 2) s = data['价格'] s.plot(ax=axis[0][0], kind='bar', title='bar') s.plot(ax=axis[0][1], kind='line', title='line') s.plot(ax=axis[1][0], kind='box', title='box') s.plot(ax=axis[1][1], kind='pie', title='pie') plt.show() ```
* 注数据文件链接: https://pan.baidu.com/s/1uXaH_hu4Oyi4QYqHDuXG3g 密码: bfnc
Sed ac lorem felis. Ut in odio lorem. Quisque magna dui, maximus ut commodo sed, vestibulum ac nibh. Aenean a tortor in sem tempus auctor
December 4, 2020 at 3:12 pm
Sed ac lorem felis. Ut in odio lorem. Quisque magna dui, maximus ut commodo sed, vestibulum ac nibh. Aenean a tortor in sem tempus auctor
December 4, 2020 at 3:12 pm
Donec in ullamcorper quam. Aenean vel nibh eu magna gravida fermentum. Praesent eget nisi pulvinar, sollicitudin eros vitae, tristique odio.
December 4, 2020 at 3:12 pm
我是 s enim interduante quis metus. Duis porta ornare nulla ut bibendum
Rosie
6 minutes ago