MCPcopy Create free account
hub / github.com/dask/dask / shift

Method shift

dask/dataframe/dask_expr/_collection.py:2022–2037  ·  view source on GitHub ↗
(self, periods=1, freq=None, axis=0)

Source from the content-addressed store, hash-verified

2020
2021 @derived_from(pd.DataFrame)
2022 def shift(self, periods=1, freq=None, axis=0):
2023 if not isinstance(periods, Integral):
2024 raise TypeError("periods must be an integer")
2025
2026 axis = _validate_axis(axis)
2027 if axis == 0:
2028 return new_collection(Shift(self, periods, freq))
2029
2030 return self.map_partitions(
2031 func=Shift.func,
2032 enforce_metadata=False,
2033 transform_divisions=False,
2034 periods=periods,
2035 axis=axis,
2036 freq=freq,
2037 )
2038
2039 @derived_from(pd.DataFrame)
2040 def diff(self, periods=1, axis=0):

Callers

nothing calls this directly

Calls 4

map_partitionsMethod · 0.95
_validate_axisFunction · 0.90
new_collectionFunction · 0.90
ShiftClass · 0.90

Tested by

no test coverage detected