我经常发现自己需要创建随机(假) DataFrames、多索引Dataframes和Series,列包括dates、numbers和strings。
Pandas提供了一种生成随机DataFrames的机制吗?或者有什么特定的包可以为这项任务提供便利?
发布于 2014-04-01 19:50:09
也许是市场数据?
>>> import pandas.io.data as web
>>> web.DataReader(["AAPL", "GOOG"], "yahoo", start='2014-03-26').to_frame()
Open High Low Close Volume Adj Close
Date minor
2014-03-26 AAPL 546.52 549.00 538.86 539.78 10706000 539.78
GOOG 1162.01 1171.57 1131.50 1131.97 2580000 1131.97
2014-03-27 AAPL 540.02 541.50 535.12 537.46 7929700 537.46
GOOG 1130.85 1131.94 1102.10 1114.28 3822200 1114.28
2014-03-28 AAPL 538.32 538.94 534.25 536.86 7106900 536.86
GOOG 1119.00 1133.19 1117.77 1120.15 2254700 1120.15
2014-03-31 AAPL 539.23 540.81 535.93 536.74 5972100 536.74
GOOG 1130.40 1135.00 1112.85 1114.51 1940500 1114.51
[8 rows x 6 columns]https://stackoverflow.com/questions/22794269
复制相似问题