[英]How to redefine datetime data by another in Pandas DataFrame?
I got this Pandas Dataframe data
.我得到了这个Pandas Dataframe
data
。 Inside, in the start column i have date in datetime format.在内部,在开始列中我有日期时间格式的日期。 In the duration column i have a timedelta format.
在持续时间列中,我有一个 timedelta 格式。 What i whanted to do is to get new datetime in the second line, [by doing 0:00+0:20=0:20.
我想做的是在第二行获得新的日期时间,[通过执行 0:00+0:20=0:20。
But when i tried to data["start"][1] = data["start"][0] + data["duration"][0]
i recieve SettingWithCopyWarning
Error.但是当我尝试
data["start"][1] = data["start"][0] + data["duration"][0]
我收到SettingWithCopyWarning
错误。
Or data["start"][2] = data["start"][1] + data["duration"][1]
.或者
data["start"][2] = data["start"][1] + data["duration"][1]
。 But it still works .但它仍然有效。 I wonder have can i fix this?
我想知道我可以解决这个问题吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.