MCPcopy Index your code
hub / github.com/dask/dask / shift

Method shift

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

Source from the content-addressed store, hash-verified

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