我有一个数据框,其中包含过去一年特定始发地和目的地的航空公司预订数据。在系统中有数百个类似的数据集。 在每个数据集中,数据中都有空洞。在当前的示例中,我们一年中有大约85天没有预订数据。 这里有两列- departure_date and bookings. 对我来说,下一步将是to include the missing dates in the date column, and set the corresponding values in bookings column to NaN. 我正在寻找最好的方法来做这件事。 请在下面找到dataFrame的一部分: Index
我有一些被划分为event-related.的值所以并不是每分钟都有相同数量的数据。为了能够更好地处理这些数据,我的目标是只有每分钟取第一行值。
从csv导入数据的时间如下所示:
时间
2011年11月11日11:11
2011年11月11日11:11
2011年11月11日11:11
2011年11月11日11:12
2011年11月11日11:12
2011年11月11日11:13
其他的数值是温度。一个主要的问题是以正确的格式导入时间。我试图用这样的方法来解决这个问题:
with open('my_file.csv','r') as file:
for l