【发布时间】:2017-05-16 20:04:08
【问题描述】:
我有以下结构,但要大得多
1y 2y 3y
1w 2 8 40
2w 3 10 50
1m 4 12 60
在python中有什么快速将其转换为单行数据帧的好方法:
1w/1y 1w/2y 1w/3y 2w/1y 2w/2y 2w/3y 1m/1y 1m/2y 1m/3y
NewIndex 2 8 40 3 10 50 4 12 60
新索引最终将是日期,因为我将以下数据存储在每个日期的单独 CSV 中,我想将其转换为单个数据框以对其运行一些统计信息。
非常感谢
Here's the image as the text got misaligned. https://i.stack.imgur.com/K3s7V.png
【问题讨论】:
标签: python python-2.7 pandas dataframe