r"""Compute grouped min aggregation. Examples: >>> import ray >>> ray.data.le(100).groupby("value").min() # doctest: +SKIP >>> ray.data.from_items([ # doctest: +SKIP ... {"A": i % 3, "B": i, "C": i**2} # doctest: +SKIP ...
(
self, on: Union[str, List[str]] = None, ignore_nulls: bool = True
)
| 436 | |
| 437 | @PublicAPI(api_group=CDS_API_GROUP) |
| 438 | def min( |
| 439 | self, on: Union[str, List[str]] = None, ignore_nulls: bool = True |
| 440 | ) -> Dataset: |
| 441 | r"""Compute grouped min aggregation. |
| 442 | |
| 443 | Examples: |
| 444 | >>> import ray |
| 445 | >>> ray.data.le(100).groupby("value").min() # doctest: +SKIP |
| 446 | >>> ray.data.from_items([ # doctest: +SKIP |
| 447 | ... {"A": i % 3, "B": i, "C": i**2} # doctest: +SKIP |
| 448 | ... for i in range(100)]) # doctest: +SKIP |
| 449 | ... .groupby("A") # doctest: +SKIP |
| 450 | ... .min(["B", "C"]) # doctest: +SKIP |
| 451 | |
| 452 | Args: |
| 453 | on: a column name or a list of column names to aggregate. |
| 454 | ignore_nulls: Whether to ignore null values. If ``True``, null |
| 455 | values will be ignored when computing the min; if ``False``, |
| 456 | if a null value is encountered, the output will be null. |
| 457 | We consider np.nan, None, and pd.NaT to be null values. |
| 458 | Default is ``True``. |
| 459 | |
| 460 | Returns: |
| 461 | The min result. |
| 462 | |
| 463 | For different values of ``on``, the return varies: |
| 464 | |
| 465 | - ``on=None``: a dataset containing a groupby key column, |
| 466 | ``"k"``, and a column-wise min column for each original column in |
| 467 | the dataset. |
| 468 | - ``on=["col_1", ..., "col_n"]``: a dataset of ``n + 1`` |
| 469 | columns where the first column is the groupby key and the second |
| 470 | through ``n + 1`` columns are the results of the aggregations. |
| 471 | |
| 472 | If groupby key is ``None`` then the key part of return is omitted. |
| 473 | """ |
| 474 | return self._aggregate_on(Min, on, ignore_nulls=ignore_nulls) |
| 475 | |
| 476 | @PublicAPI(api_group=CDS_API_GROUP) |
| 477 | def max( |
nothing calls this directly
no test coverage detected