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

Method reduction

dask/dataframe/dask_expr/_collection.py:2126–2267  ·  view source on GitHub ↗

Generic row-wise reductions. Parameters ---------- chunk : callable Function to operate on each partition. Should return a ``pandas.DataFrame``, ``pandas.Series``, or a scalar. aggregate : callable, optional Function to operate on

(
        self,
        chunk,
        aggregate=None,
        combine=None,
        meta=no_default,
        token=None,
        split_every=None,
        chunk_kwargs=None,
        aggregate_kwargs=None,
        combine_kwargs=None,
        **kwargs,
    )

Source from the content-addressed store, hash-verified

2124 return new_collection(self.expr.cummin(skipna=skipna))
2125
2126 def reduction(
2127 self,
2128 chunk,
2129 aggregate=None,
2130 combine=None,
2131 meta=no_default,
2132 token=None,
2133 split_every=None,
2134 chunk_kwargs=None,
2135 aggregate_kwargs=None,
2136 combine_kwargs=None,
2137 **kwargs,
2138 ):
2139 """Generic row-wise reductions.
2140
2141 Parameters
2142 ----------
2143 chunk : callable
2144 Function to operate on each partition. Should return a
2145 ``pandas.DataFrame``, ``pandas.Series``, or a scalar.
2146 aggregate : callable, optional
2147 Function to operate on the concatenated result of ``chunk``. If not
2148 specified, defaults to ``chunk``. Used to do the final aggregation
2149 in a tree reduction.
2150
2151 The input to ``aggregate`` depends on the output of ``chunk``.
2152 If the output of ``chunk`` is a:
2153
2154 - scalar: Input is a Series, with one row per partition.
2155 - Series: Input is a DataFrame, with one row per partition. Columns
2156 are the rows in the output series.
2157 - DataFrame: Input is a DataFrame, with one row per partition.
2158 Columns are the columns in the output dataframes.
2159
2160 Should return a ``pandas.DataFrame``, ``pandas.Series``, or a
2161 scalar.
2162 combine : callable, optional
2163 Function to operate on intermediate concatenated results of
2164 ``chunk`` in a tree-reduction. If not provided, defaults to
2165 ``aggregate``. The input/output requirements should match that of
2166 ``aggregate`` described above.
2167 $META
2168 token : str, optional
2169 The name to use for the output keys.
2170 split_every : int, optional
2171 Group partitions into groups of this size while performing a
2172 tree-reduction. If set to False, no tree-reduction will be used,
2173 and all intermediates will be concatenated and passed to
2174 ``aggregate``. Default is 8.
2175 chunk_kwargs : dict, optional
2176 Keyword arguments to pass on to ``chunk`` only.
2177 aggregate_kwargs : dict, optional
2178 Keyword arguments to pass on to ``aggregate`` only.
2179 combine_kwargs : dict, optional
2180 Keyword arguments to pass on to ``combine`` only.
2181 kwargs :
2182 All remaining keywords will be passed to ``chunk``, ``combine``,
2183 and ``aggregate``.

Calls 3

new_collectionFunction · 0.90
CustomReductionClass · 0.90
copyMethod · 0.45