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

Method reduction

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

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

Calls 3

new_collectionFunction · 0.90
CustomReductionClass · 0.90
copyMethod · 0.45