【发布时间】:2019-06-23 09:43:15
【问题描述】:
我在 CSV 文件中有如下数据
Date Temperature_city_1 Temperature_city_2 Temperature_city_3 Which_destination
20140910 80 32 40 1
20140911 100 50 36 2
20140912 102 55 46 1
20140912 60 20 35 3
20140914 60 20 32 3
20140914 60 57 42 2
我需要以下格式的平面文件中的这些数据
Date
Temperature_city_1
Temperature_city_2
Temperature_city_3
Which_destination
20140910
80
32
40
1
20140911
100
50
36
2
...
我正在尝试使用 pandas 并将这些数据写入平面文件,但没有运气。 尝试了示例代码,但没有运气
【问题讨论】:
标签: python pandas dataframe file-io flat-file