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

Method resample_as_pandas

xarray/tests/test_groupby.py:1906–1917  ·  view source on GitHub ↗
(array, *args, **kwargs)

Source from the content-addressed store, hash-verified

1904 )
1905
1906 def resample_as_pandas(array, *args, **kwargs):
1907 array_ = array.copy(deep=True)
1908 if use_cftime:
1909 array_["time"] = times.to_datetimeindex(time_unit="ns")
1910 result = DataArray.from_series(
1911 array_.to_series().resample(*args, **kwargs).mean()
1912 )
1913 if use_cftime:
1914 result = result.convert_calendar(
1915 calendar="standard", use_cftime=use_cftime
1916 )
1917 return result
1918
1919 array = DataArray(np.arange(10), [("time", times)])
1920

Callers

nothing calls this directly

Calls 7

to_datetimeindexMethod · 0.80
from_seriesMethod · 0.80
to_seriesMethod · 0.80
copyMethod · 0.45
meanMethod · 0.45
resampleMethod · 0.45
convert_calendarMethod · 0.45

Tested by

no test coverage detected