diff options
| author | melissawm <melissawm@gmail.com> | 2021-02-05 14:05:34 -0300 |
|---|---|---|
| committer | melissawm <melissawm@gmail.com> | 2021-02-05 14:17:42 -0300 |
| commit | 46b5b0d428bbe3216140e799ca4aaa2507b8293e (patch) | |
| tree | 8f0cb39882a0f3d4ed2ad887bd2c627dd432bb54 /doc/source/reference | |
| parent | 0a1bd4ead41b1fdfb53142097b5e08555f280545 (diff) | |
| download | numpy-46b5b0d428bbe3216140e799ca4aaa2507b8293e.tar.gz | |
DOC: Discussion on the @ operator and the matrix class
Diffstat (limited to 'doc/source/reference')
| -rw-r--r-- | doc/source/reference/arrays.classes.rst | 2 | ||||
| -rw-r--r-- | doc/source/reference/arrays.ndarray.rst | 6 | ||||
| -rw-r--r-- | doc/source/reference/routines.linalg.rst | 16 |
3 files changed, 21 insertions, 3 deletions
diff --git a/doc/source/reference/arrays.classes.rst b/doc/source/reference/arrays.classes.rst index 3a4ed2168..92c271f6b 100644 --- a/doc/source/reference/arrays.classes.rst +++ b/doc/source/reference/arrays.classes.rst @@ -330,6 +330,8 @@ NumPy provides several hooks that classes can customize: returned by :func:`__array__`. This practice will return ``TypeError``. +.. _matrix-objects: + Matrix objects ============== diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst index 191367058..106ccd7cb 100644 --- a/doc/source/reference/arrays.ndarray.rst +++ b/doc/source/reference/arrays.ndarray.rst @@ -567,10 +567,10 @@ Matrix Multiplication: .. note:: Matrix operators ``@`` and ``@=`` were introduced in Python 3.5 - following PEP465. NumPy 1.10.0 has a preliminary implementation of ``@`` - for testing purposes. Further documentation can be found in the - :func:`matmul` documentation. + following PEP465_ and are available since NumPy 1.10.0. Further + information can be found in the :func:`matmul` documentation. +.. _PEP465: https://www.python.org/dev/peps/pep-0465/ Special methods =============== diff --git a/doc/source/reference/routines.linalg.rst b/doc/source/reference/routines.linalg.rst index 86e168b26..97bdf3974 100644 --- a/doc/source/reference/routines.linalg.rst +++ b/doc/source/reference/routines.linalg.rst @@ -30,10 +30,26 @@ flexible broadcasting options. For example, `numpy.linalg.solve` can handle "stacked" arrays, while `scipy.linalg.solve` accepts only a single square array as its first argument. +.. note:: + + The term *matrix* as it is used on this page indicates a 2d `numpy.array` + object, and *not* a `numpy.matrix` object. The latter is no longer + recommended, even for linear algebra. See + :ref:`the matrix object documentation<matrix-objects>` for + more information. + +The ``@`` operator +------------------ + +Introduced in NumPy 1.10.0, the ``@`` and ``@=`` operators are preferable to +other methods when computing the matrix product between 2d arrays. The +:func:`numpy.matmul` function implements the semantics of the ``@`` operator. + .. currentmodule:: numpy Matrix and vector products -------------------------- + .. autosummary:: :toctree: generated/ |
