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

Method diff

dask/dataframe/dask_expr/_collection.py:2040–2060  ·  view source on GitHub ↗

.. note:: Pandas currently uses an ``object``-dtype column to represent boolean data with missing values. This can cause issues for boolean-specific operations, like ``|``. To enable boolean- specific operations, at the cost of metadata that does

(self, periods=1, axis=0)

Source from the content-addressed store, hash-verified

2038
2039 @derived_from(pd.DataFrame)
2040 def diff(self, periods=1, axis=0):
2041 """
2042 .. note::
2043
2044 Pandas currently uses an ``object``-dtype column to represent
2045 boolean data with missing values. This can cause issues for
2046 boolean-specific operations, like ``|``. To enable boolean-
2047 specific operations, at the cost of metadata that doesn't match
2048 pandas, use ``.astype(bool)`` after the ``shift``.
2049 """
2050 axis = _validate_axis(axis)
2051 if axis == 0:
2052 return new_collection(Diff(self, periods))
2053 return self.map_partitions(
2054 func=Diff.func,
2055 enforce_metadata=False,
2056 transform_divisions=False,
2057 clear_divisions=False,
2058 periods=periods,
2059 axis=axis,
2060 )
2061
2062 @derived_from(pd.DataFrame)
2063 def rename_axis(

Callers 15

_layerMethod · 0.80
_metaMethod · 0.80
test_diffFunction · 0.80
test_diffFunction · 0.80
takeFunction · 0.80
merge_percentilesFunction · 0.80
histogramFunction · 0.80
histogramddFunction · 0.80
insertFunction · 0.80
test_diffFunction · 0.80
test_diff_prependFunction · 0.80
test_diff_appendFunction · 0.80

Calls 4

map_partitionsMethod · 0.95
_validate_axisFunction · 0.90
new_collectionFunction · 0.90
DiffClass · 0.90

Tested by 13

test_diffFunction · 0.64
test_diffFunction · 0.64
test_diffFunction · 0.64
test_diff_prependFunction · 0.64
test_diff_appendFunction · 0.64
test_diff_negative_orderFunction · 0.64
mydiffFunction · 0.64
test_apply_gufunc_axisFunction · 0.64
mydiffFunction · 0.64
test_diffFunction · 0.64
test_diff_prependFunction · 0.64