DA
来自Jack's Lab
(版本间的差异)
(→探索数据分布) |
(→bar) |
||
第29行: | 第29行: | ||
<source lang=python> | <source lang=python> | ||
− | hb = pd.read_csv("../DA/data/ncp-hb-new.csv", index_col='Date', parse_dates=True, skipinitialspace=True) | + | hb = pd.read_csv("../DA/data/ncp-hb-new.csv", index_col='Date', parse_dates=True, skipinitialspace=True) |
− | cn = pd.read_csv("../DA/data/ncp-cn-new.csv", index_col='Date', parse_dates=True, skipinitialspace=True) | + | cn = pd.read_csv("../DA/data/ncp-cn-new.csv", index_col='Date', parse_dates=True, skipinitialspace=True) |
− | xhb = cn-hb | + | xhb = cn-hb |
− | xhb_cf = xhb['Confirmed'].values | + | xhb_cf = xhb['Confirmed'].values |
− | plt.bar(xhb.index, xhb_cf) | + | plt.bar(xhb.index, xhb_cf) |
− | plt.gca().xaxis.set_major_formatter(mdate.DateFormatter('%m-%d')) | + | plt.gca().xaxis.set_major_formatter(mdate.DateFormatter('%m-%d')) |
− | plt.show() | + | plt.show() |
</source> | </source> | ||
2020年2月16日 (日) 19:44的版本
目录 |
1 Overview
2 描述性统计
3 探索数据分布
3.1 bar
hb = pd.read_csv("../DA/data/ncp-hb-new.csv", index_col='Date', parse_dates=True, skipinitialspace=True) cn = pd.read_csv("../DA/data/ncp-cn-new.csv", index_col='Date', parse_dates=True, skipinitialspace=True) xhb = cn-hb xhb_cf = xhb['Confirmed'].values plt.bar(xhb.index, xhb_cf) plt.gca().xaxis.set_major_formatter(mdate.DateFormatter('%m-%d')) plt.show()
4 时序数据分析
5 Reference
- Numpy API reference
- Pandas API reference
- matplotlib Gallery
- Change the Colors Changes to the default style
- matplotlib.pyplot.plot()
- matplotlib.pyplot.figure()
- Time Series Analysis Example
- Introduction to Data Science
- Data Visualization tutorial
- FlowingData Tutorials