Reduce this NamedArray's data by applying ``min`` along some dimension(s). Parameters ---------- dim : str, Iterable of Hashable, "..." or None, default: None Name of dimension[s] along which to apply ``min``. For e.g. ``dim="x"`` or ``dim=["
(
self,
dim: Dims = None,
*,
skipna: bool | None = None,
**kwargs: Any,
)
| 248 | ) |
| 249 | |
| 250 | def min( |
| 251 | self, |
| 252 | dim: Dims = None, |
| 253 | *, |
| 254 | skipna: bool | None = None, |
| 255 | **kwargs: Any, |
| 256 | ) -> Self: |
| 257 | """ |
| 258 | Reduce this NamedArray's data by applying ``min`` along some dimension(s). |
| 259 | |
| 260 | Parameters |
| 261 | ---------- |
| 262 | dim : str, Iterable of Hashable, "..." or None, default: None |
| 263 | Name of dimension[s] along which to apply ``min``. For e.g. ``dim="x"`` |
| 264 | or ``dim=["x", "y"]``. If "..." or None, will reduce over all dimensions. |
| 265 | skipna : bool or None, optional |
| 266 | If True, skip missing values (as marked by NaN). By default, only |
| 267 | skips missing values for float dtypes; other dtypes either do not |
| 268 | have a sentinel missing value (int) or ``skipna=True`` has not been |
| 269 | implemented (object, datetime64 or timedelta64). |
| 270 | **kwargs : Any |
| 271 | Additional keyword arguments passed on to the appropriate array |
| 272 | function for calculating ``min`` on this object's data. |
| 273 | These could include dask-specific kwargs like ``split_every``. |
| 274 | |
| 275 | Returns |
| 276 | ------- |
| 277 | reduced : NamedArray |
| 278 | New NamedArray with ``min`` applied to its data and the |
| 279 | indicated dimension(s) removed |
| 280 | |
| 281 | See Also |
| 282 | -------- |
| 283 | numpy.min |
| 284 | dask.array.min |
| 285 | Dataset.min |
| 286 | DataArray.min |
| 287 | :ref:`agg` |
| 288 | User guide on reduction or aggregation operations. |
| 289 | |
| 290 | Examples |
| 291 | -------- |
| 292 | >>> from xarray.namedarray.core import NamedArray |
| 293 | >>> na = NamedArray("x", np.array([1, 2, 3, 0, 2, np.nan])) |
| 294 | >>> na |
| 295 | <xarray.NamedArray (x: 6)> Size: 48B |
| 296 | array([ 1., 2., 3., 0., 2., nan]) |
| 297 | |
| 298 | >>> na.min() |
| 299 | <xarray.NamedArray ()> Size: 8B |
| 300 | array(0.) |
| 301 | |
| 302 | Use ``skipna`` to control whether NaNs are ignored. |
| 303 | |
| 304 | >>> na.min(skipna=False) |
| 305 | <xarray.NamedArray ()> Size: 8B |
| 306 | array(nan) |
| 307 | """ |