【发布时间】:2021-02-26 01:43:33
【问题描述】:
[![在此处输入图像描述][1]][1]我有一个特定形状的天气数据的数据框,我想对其进行转换,但正在苦苦挣扎。 我的数据框看起来像这样:
city temp_day1, temp_day2, temp_day3 ...., hum_day1, hum_day2, hum_day4, ..., condition
city_1 12 13 20 44 44.5 good 44
city_1 12 13 20 44 44.5
不好 44
city_2 14 04 33 44 44.5
好 44
我想把它改成
city_1 city_2 .....
day. temperature humidity condition ... temperature humidity condition
1 12 44 good . 12 13
20 44 44.5
2 13 44 .5 bad .
3 20 NaN bad .
4 NaN 44 .
有一天没有温度值和湿度值
感谢您的帮助
【问题讨论】:
标签: python-3.x pandas dataframe time-series