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

Method diff

dask/dataframe/dask_expr/_collection.py:2036–2056  ·  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

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