From f40bb85aaf3c58cd1848f465f3063e6d3fd0ba78 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 13 Apr 2024 12:36:17 +0200 Subject: [PATCH] use `pd.to_timedelta` instead of `TimedeltaIndex` --- xarray/tests/test_missing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/tests/test_missing.py b/xarray/tests/test_missing.py index c1d1058fd6e..5968c9687fb 100644 --- a/xarray/tests/test_missing.py +++ b/xarray/tests/test_missing.py @@ -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])}