【发布时间】:2017-06-16 21:31:33
【问题描述】:
我有一个包含datetime64[ns] 元素的系列,名为series,并且想增加月份。我认为以下内容可以正常工作,但事实并非如此:
series.dt.month += 1
错误是
ValueError: modifications to a property of a datetimelike object are not supported. Change values on the original.
有没有不需要重新定义的简单方法来实现这一点?
【问题讨论】:
标签: python python-3.x pandas datetime python-datetime