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

Method shift

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

Source from the content-addressed store, hash-verified

2056
2057 @derived_from(pd.DataFrame)
2058 def shift(self, periods=1, freq=None, axis=0):
2059 if not isinstance(periods, Integral):
2060 raise TypeError("periods must be an integer")
2061
2062 axis = _validate_axis(axis)
2063 if axis == 0:
2064 return new_collection(Shift(self, periods, freq))
2065
2066 return self.map_partitions(
2067 func=Shift.func,
2068 enforce_metadata=False,
2069 transform_divisions=False,
2070 periods=periods,
2071 axis=axis,
2072 freq=freq,
2073 )
2074
2075 @derived_from(pd.DataFrame)
2076 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