Skip to content

Commit

Permalink
use pd.to_timedelta instead of TimedeltaIndex (#8938)
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis authored Apr 13, 2024
1 parent e481094 commit aa08785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/tests/test_missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def make_interpolate_example_data(shape, frac_nan, seed=12345, non_uniform=False

if non_uniform:
# construct a datetime index that has irregular spacing
deltas = pd.TimedeltaIndex(unit="d", data=rs.normal(size=shape[0], scale=10))
deltas = pd.to_timedelta(rs.normal(size=shape[0], scale=10), unit="d")
coords = {"time": (pd.Timestamp("2000-01-01") + deltas).sort_values()}
else:
coords = {"time": pd.date_range("2000-01-01", freq="D", periods=shape[0])}
Expand Down

0 comments on commit aa08785

Please sign in to comment.