1. 使用DataFrame
from pandas as pd
2. 创建DataFrame对象
参考: http://www.cnblogs.com/jinhaolin/p/5980932.html
参考: http://blog.csdn.net/u014607457/article/details/51290582
dates = ['2017-08-01', '2017-08-02', '2017-08-03', '2017-08-04'] d = { 'a': [1, 2, 3, 4], 'b': [11, 12, 13, 14], 'c': ['a', 'b', 'c', 'd'] } df = pd.DataFrame(d, index=dates, columns=['a', 'b', 'c'])
2.1 通过tushare获得DataFrame对象
df = ts.get_tick_data('000001', date='2017-09-01')
OK, 我们就拿df对象来演示
3. 一个df是由n个pandas.core.series.Series对象构成。
type(df.time) ==> pandas.core.series.Series
type(a.price.values) ==> numpy.ndarray
4. reindex
reindex重新修改索引的(顺序),
DOC: http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.reindex.html