MCPcopy Index your code
hub / github.com/pydata/xarray / std

Method std

xarray/namedarray/_aggregations.py:546–624  ·  view source on GitHub ↗

Reduce this NamedArray's data by applying ``std`` along some dimension(s). Parameters ---------- dim : str, Iterable of Hashable, "..." or None, default: None Name of dimension[s] along which to apply ``std``. For e.g. ``dim="x"`` or ``dim=["

(
        self,
        dim: Dims = None,
        *,
        skipna: bool | None = None,
        ddof: int = 0,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

544 )
545
546 def std(
547 self,
548 dim: Dims = None,
549 *,
550 skipna: bool | None = None,
551 ddof: int = 0,
552 **kwargs: Any,
553 ) -> Self:
554 """
555 Reduce this NamedArray's data by applying ``std`` along some dimension(s).
556
557 Parameters
558 ----------
559 dim : str, Iterable of Hashable, "..." or None, default: None
560 Name of dimension[s] along which to apply ``std``. For e.g. ``dim="x"``
561 or ``dim=["x", "y"]``. If "..." or None, will reduce over all dimensions.
562 skipna : bool or None, optional
563 If True, skip missing values (as marked by NaN). By default, only
564 skips missing values for float dtypes; other dtypes either do not
565 have a sentinel missing value (int) or ``skipna=True`` has not been
566 implemented (object, datetime64 or timedelta64).
567 ddof : int, default: 0
568 “Delta Degrees of Freedom”: the divisor used in the calculation is ``N - ddof``,
569 where ``N`` represents the number of elements.
570 **kwargs : Any
571 Additional keyword arguments passed on to the appropriate array
572 function for calculating ``std`` on this object's data.
573 These could include dask-specific kwargs like ``split_every``.
574
575 Returns
576 -------
577 reduced : NamedArray
578 New NamedArray with ``std`` applied to its data and the
579 indicated dimension(s) removed
580
581 See Also
582 --------
583 numpy.std
584 dask.array.std
585 Dataset.std
586 DataArray.std
587 :ref:`agg`
588 User guide on reduction or aggregation operations.
589
590 Notes
591 -----
592 Non-numeric variables will be removed prior to reducing.
593
594 Examples
595 --------
596 >>> from xarray.namedarray.core import NamedArray
597 >>> na = NamedArray("x", np.array([1, 2, 3, 0, 2, np.nan]))
598 >>> na
599 <xarray.NamedArray (x: 6)> Size: 48B
600 array([ 1., 2., 3., 0., 2., nan])
601
602 >>> na.std()
603 <xarray.NamedArray ()> Size: 8B

Callers

nothing calls this directly

Calls 1

reduceMethod · 0.95

Tested by

no test coverage detected