我在pandas
中有一个温度数据框,其创建如下:
+----------+-----+-----+
| date | hour| temp|
+----------+-----+-----+
|2000-01-01| 2 | -8 |
+----------+-----+-----+
|2000-01-01| 3 | -10 |
+----------+-----+-----+
|2000-01-02| 4 | -11 |
+----------+-----+-----+
|2000-01-02| 11 | -8 |
+----------+-----+-----+
|2000-01-03| 2 | -7 |
+----------+-----+-----+
我想将其更改为以下数据框:
+-------------------+-----+
| date | temp|
+-------------------+-----+
|2000-01-01 02:00:00| -8 |
+-------------------+-----+
|2000-01-01 03:00:00| -10 |
+-------------------+-----+
|2000-01-02 04:00:00| -11 |
+-------------------+-----+
|2000-01-02 11:00:00| -8 |
+-------------------+-----+
|2000-01-03 02:00:00| -7 |
+-------------------+-----+
有什么想法吗?