import dascore as dc
= dc.get_example_patch()
patch
# Get maximum along distance dimension
= patch.max(dim='distance')
max_patch assert max_patch.size < patch.size
max
max(
patch: Patch ,
dim: str | collections.abc.Sequence[str, collections.abc.Sequence[str], None] = None,
dim_reduce: str | collections.abc.Callable[str, Callable] = empty,
)-> ‘PatchType’
Calculate the maximum along one or more dimensions.
Parameters
Parameter | Description |
---|---|
patch | The input Patch. |
dim |
The dimension along which aggregations are to be performed. If None, apply aggregation to all dimensions sequentially. If a sequence, apply sequentially in order provided. |
dim_reduce |
How to reduce the dimensional coordinate associated with the aggregated axis. Can be the name of any valid aggregator, a callable, “empty” (the default) which returns a length 1 partial coord, or “squeeze” which drops the coordinate. For dimensions with datetime or timedelta datatypes, if the operation fails it will automatically be applied to the coordinates converted to floats then the output converted back to the appropriate time type. |
Examples
Note
See Patch.aggregate
for examples and more details.