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

Method test_resample_keep_attrs

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

Source from the content-addressed store, hash-verified

2064 assert "tc" not in actual.coords
2065
2066 def test_resample_keep_attrs(self) -> None:
2067 times = pd.date_range("2000-01-01", freq="6h", periods=10)
2068 array = DataArray(np.ones(10), [("time", times)])
2069 array.attrs["meta"] = "data"
2070
2071 result = array.resample(time="1D").mean(keep_attrs=True)
2072 expected = DataArray([1, 1, 1], [("time", times[::4])], attrs=array.attrs)
2073 assert_identical(result, expected)
2074
2075 def test_resample_skipna(self) -> None:
2076 times = pd.date_range("2000-01-01", freq="6h", periods=10)

Callers

nothing calls this directly

Calls 4

resampleMethod · 0.95
DataArrayClass · 0.90
assert_identicalFunction · 0.90
meanMethod · 0.45

Tested by

no test coverage detected