diff options
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 |