MCPcopy Index your code
hub / github.com/numpy/numpy / std

Method std

numpy/matrixlib/defmatrix.py:451–484  ·  view source on GitHub ↗

Return the standard deviation of the array elements along the given axis. Refer to `numpy.std` for full documentation. See Also -------- numpy.std Notes ----- This is the same as `ndarray.std`, except that where an `ndarray` would

(self, axis=None, dtype=None, out=None, ddof=0)

Source from the content-addressed store, hash-verified

449 return N.ndarray.mean(self, axis, dtype, out, keepdims=True)._collapse(axis)
450
451 def std(self, axis=None, dtype=None, out=None, ddof=0):
452 """
453 Return the standard deviation of the array elements along the given axis.
454
455 Refer to `numpy.std` for full documentation.
456
457 See Also
458 --------
459 numpy.std
460
461 Notes
462 -----
463 This is the same as `ndarray.std`, except that where an `ndarray` would
464 be returned, a `matrix` object is returned instead.
465
466 Examples
467 --------
468 >>> x = np.matrix(np.arange(12).reshape((3, 4)))
469 >>> x
470 matrix([[ 0, 1, 2, 3],
471 [ 4, 5, 6, 7],
472 [ 8, 9, 10, 11]])
473 >>> x.std()
474 3.4520525295346629 # may vary
475 >>> x.std(0)
476 matrix([[ 3.26598632, 3.26598632, 3.26598632, 3.26598632]]) # may vary
477 >>> x.std(1)
478 matrix([[ 1.11803399],
479 [ 1.11803399],
480 [ 1.11803399]])
481
482 """
483 return N.ndarray.std(self, axis, dtype, out, ddof,
484 keepdims=True)._collapse(axis)
485
486 def var(self, axis=None, dtype=None, out=None, ddof=0):
487 """

Callers 1

Calls 1

_collapseMethod · 0.80

Tested by 1