summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-10-21 18:05:09 -0600
committerGitHub <noreply@github.com>2021-10-21 18:05:09 -0600
commitd8653001e5342d002b133dce999286fcafbd8bf0 (patch)
treee897ee3508a98798f271c2cdf7befc6e83e6c672 /doc/source
parent14d952da1b3095f5c8411761071610038d9fa648 (diff)
parent707985360ac671006951b2d39dceef9ba6e38cae (diff)
downloadnumpy-d8653001e5342d002b133dce999286fcafbd8bf0.tar.gz
Merge pull request #20115 from rossbar/doc/absolute-beginners-match-axis-reduction-img
DOC: Modify code in absolute beginners tutorial to match image
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/user/absolute_beginners.rst10
1 files changed, 8 insertions, 2 deletions
diff --git a/doc/source/user/absolute_beginners.rst b/doc/source/user/absolute_beginners.rst
index bb570f622..a98ca3e40 100644
--- a/doc/source/user/absolute_beginners.rst
+++ b/doc/source/user/absolute_beginners.rst
@@ -899,12 +899,18 @@ You can aggregate matrices the same way you aggregated vectors::
.. image:: images/np_matrix_aggregation.png
You can aggregate all the values in a matrix and you can aggregate them across
-columns or rows using the ``axis`` parameter::
+columns or rows using the ``axis`` parameter. To illustrate this point, let's
+look at a slightly modified dataset::
+ >>> data = np.array([[1, 2], [5, 3], [4, 6]])
+ >>> data
+ array([[1, 2],
+ [5, 3],
+ [4, 6]])
>>> data.max(axis=0)
array([5, 6])
>>> data.max(axis=1)
- array([2, 4, 6])
+ array([2, 5, 6])
.. image:: images/np_matrix_aggregation_row.png