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

Method shift

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

Source from the content-addressed store, hash-verified

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