We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7e7dce commit 656a00dCopy full SHA for 656a00d
pandas/_libs/tslibs/offsets.pyx
@@ -1157,8 +1157,9 @@ cdef class RelativeDeltaOffset(BaseOffset):
1157
return dt64other
1158
elif not self._use_relativedelta and hasattr(self, "_offset"):
1159
# timedelta
1160
- if hasattr(self, "nanoseconds"):
1161
- rem_nano = Timedelta(nanoseconds=self.nanoseconds)
+ num_nano = getattr(self, "nanoseconds", 0)
+ if num_nano != 0:
1162
+ rem_nano = Timedelta(nanoseconds=num_nano)
1163
delta = Timedelta((self._offset + rem_nano) * self.n)
1164
else:
1165
delta = Timedelta((self._offset) * self.n)
0 commit comments