diff options
author | Dan Allan <dallan@bnl.gov> | 2019-07-14 10:03:40 -0500 |
---|---|---|
committer | Dan Allan <dallan@bnl.gov> | 2019-07-14 10:04:06 -0500 |
commit | 54911b6365bd4931055cc134dd10c9b0639d07dc (patch) | |
tree | 4259f191bd718e2df73fc2bb26e7866d9870ab8f /numpy/doc/dispatch.py | |
parent | d96618f25db01d814a2159f740cc36e1f355d9d8 (diff) | |
download | numpy-54911b6365bd4931055cc134dd10c9b0639d07dc.tar.gz |
Copy editing
Diffstat (limited to 'numpy/doc/dispatch.py')
-rw-r--r-- | numpy/doc/dispatch.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/doc/dispatch.py b/numpy/doc/dispatch.py index f592d4ffd..313167005 100644 --- a/numpy/doc/dispatch.py +++ b/numpy/doc/dispatch.py @@ -214,6 +214,8 @@ to add functions to ``HANDLED_FUNCTIONS``. ... Now we write implementations of numpy functions for ``DiagonalArray``. +For completeness, to support the usage ``arr.sum()`` add a method ``sum`` that +calls ``numpy.sum(self)``, and the same for ``mean``. >>> @implements(np.sum) ... def sum(a, axis=None, out=None): @@ -233,9 +235,6 @@ Now we write implementations of numpy functions for ``DiagonalArray``. >>> np.mean(arr) 0.2 -For completeness, to support the usage ``arr.sum()`` add a method ``sum`` that -calls ``numpy.sum(self)``, and the same for ``mean``. - If the user tries to use any numpy functions not included in ``HANDLED_FUNCTIONS``, a ``TypeError`` will be raised by numpy, indicating that this operation is not supported. For example, concatenating two |