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