我想转换字典,
{'IBM': Date
2014-01-02 NaN
2014-01-03 0.006004
2014-01-06 -0.003426
2014-01-07 0.019908
2014-01-08 -0.009134
2014-01-09 -0.003183
2014-01-10 -0.000606
Freq: B, Name: IBM, dtype: float64, 'MSFT': Date
2014-01-02 NaN
2014-01-03 -0.006683
2014-01-06 -0.021026
2014-01-07 0.007732
2014-01-08 -0.017903
2014-01-09 -0.006366
2014-01-10 0.014269
Freq: B, Name: MSFT, dtype: float64, 'ORCL': Date......
到以下数据框,
Date IBM MSFT
1/2/2014 NaN NaN
1/3/2014 0.006004 -0.006683
1/6/2014 -0.003426 -0.021026
1/7/2014 0.019908 0.007732
1/8/2014 -0.009134 -0.017903
1/9/2014 -0.003183 -0.006366
1/10/2014 -0.000606 0.014269
答案 0 :(得分:1)
很简单,pandas.DataFrame.from_dict()
http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.from_dict.html