Skip to content

Commit

Permalink
fix cftime_to_nptime in cftimeindex
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Jan 9, 2025
1 parent 470235e commit e619a4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/coding/cftimeindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def to_datetimeindex(self, unsafe=False):
return pd.DatetimeIndex([])

# transform to us-resolution is needed for DatetimeIndex
nptimes = cftime_to_nptime(self).astype("=M8[us]")
nptimes = cftime_to_nptime(self, time_unit="us")
calendar = infer_calendar_name(self)
if calendar not in _STANDARD_CALENDARS and not unsafe:
warnings.warn(
Expand Down

0 comments on commit e619a4c

Please sign in to comment.