MCPcopy Index your code
hub / github.com/pydata/xarray / test_resample_offset

Method test_resample_offset

xarray/tests/test_groupby.py:2322–2329  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2320 assert_allclose(expected, actual, rtol=1e-16)
2321
2322 def test_resample_offset(self) -> None:
2323 times = pd.date_range("2000-01-01T02:03:01", freq="6h", periods=10)
2324 array = DataArray(np.arange(10), [("time", times)])
2325
2326 offset = pd.Timedelta("11h")
2327 actual = array.resample(time="24h", offset=offset).mean()
2328 expected = DataArray(array.to_series().resample("24h", offset=offset).mean())
2329 assert_identical(expected, actual)
2330
2331 def test_resample_origin(self) -> None:
2332 times = pd.date_range("2000-01-01T02:03:01", freq="6h", periods=10)

Callers

nothing calls this directly

Calls 7

resampleMethod · 0.95
to_seriesMethod · 0.95
DataArrayClass · 0.90
assert_identicalFunction · 0.90
arangeMethod · 0.80
meanMethod · 0.45
resampleMethod · 0.45

Tested by

no test coverage detected