1

我想像这样遍历 Dataframe:

for i in y.itertuples(): print i

结果:

(datetime.date(2012, 9, 10), 63.930000305175781, 64.589996337890625, 63.880001068115234, 64.099998474121094, 507700.0, 64.099998474121094)
(datetime.date(2012, 9, 11), 63.490001678466797, 63.790000915527344, 62.509998321533203, 63.759998321533203, 896600.0, 63.759998321533203)

如何通过索引日期对象创建每个迭代元组的新数据框?

4

1 回答 1

2
pd.DataFrame.from_records([i], index=0)
于 2012-10-15T06:54:09.460 回答