我有一个数据帧列表
df1 =
Stock Year Profit CountPercent
AAPL 2012 1 38.77
AAPL 2013 1 33.33
df2 =
Stock Year Profit CountPercent
GOOG 2012 1 43.47
GOOG 2013 1 32.35
df3 =
Stock Year Profit CountPercent
ABC 2012 1 40.00
ABC 2013 1 32.35
函数的输出是[df1,df2,df3,......
]像这样,
数据框中的所有列将相同,但行将不同
如何将这些存储在硬盘中,并以最快和最有效的方式再次作为列表检索?在
我认为如果所有的df都具有相同的形状,那么将数据存储为
pandas.Panel
而不是DFs列表,这就是pandas_datareader的工作原理商店:
^{pr2}$面板尺寸:
如果列} 删除此列并使用}的第一个值):
Stock
中的值相同,则可以通过^{dict comprehension
(键是每个df
中列{对于存储在
disk
中,我认为最好使用hdf5 pytables。在如果每个} 全部
^{pr2}$Stack
列中的值相同,则可以^{df
并存储它:相关问题 更多 >
编程相关推荐