首先根据日期将日期调整为属于有效日期roll规则,然后将偏移量应用于有效天数中的给定日期。
1.7.0版中的新功能。
参数:dates: : array_like of datetime64[D]
要处理的日期数组。
offsets: : array_like of int
偏移量数组,通过dates。
roll: : {‘raise’, ‘nat’, ‘forward’, ‘following’, ‘backward’, ‘preceding’, ‘modifiedfollowing’, ‘modifiedpreceding’}, 可选参数
如何处理非有效日期的日期。默认值为‘raise’。
‘raise’ means to raise an exception for an invalid day.
‘nat’ means to return a NaT (not-a-time) for an invalid day.
‘forward’ and ‘following’ mean to take the first valid day
later in time.
‘backward’ and ‘preceding’ mean to take the first valid day
earlier in time.
‘modifiedfollowing’ means to take the first valid day
later in time unless it is across a Month boundary, in which
case to take the first valid day earlier in time.
‘modifiedpreced