MCPcopy
hub / github.com/pydata/xarray / test_resample_origin

Method test_resample_origin

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

Source from the content-addressed store, hash-verified

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)
2333 array = DataArray(np.arange(10), [("time", times)])
2334
2335 origin: Literal["start"] = "start"
2336 actual = array.resample(time="24h", origin=origin).mean()
2337 expected = DataArray(array.to_series().resample("24h", origin=origin).mean())
2338 assert_identical(expected, actual)
2339
2340
2341class TestDatasetResample:

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