We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a2511c commit 54cb25eCopy full SHA for 54cb25e
pandas/core/common.py
@@ -85,10 +85,12 @@ def maybe_box_datetimelike(value):
85
# turn a datetime like into a Timestamp/timedelta as needed
86
87
if isinstance(value, (np.datetime64, datetime)) \
88
- and not isinstance(value, tslibs.Timestamp):
+ and not isinstance(value, tslibs.Timestamp) \
89
+ and notnull(value):
90
value = tslibs.Timestamp(value)
91
elif isinstance(value, (np.timedelta64, timedelta)) \
- and not isinstance(value, tslibs.Timedelta):
92
+ and not isinstance(value, tslibs.Timedelta) \
93
94
value = tslibs.Timedelta(value)
95
96
return value
0 commit comments