diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-10-21 18:05:09 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-21 18:05:09 -0600 |
commit | d8653001e5342d002b133dce999286fcafbd8bf0 (patch) | |
tree | e897ee3508a98798f271c2cdf7befc6e83e6c672 /doc/source | |
parent | 14d952da1b3095f5c8411761071610038d9fa648 (diff) | |
parent | 707985360ac671006951b2d39dceef9ba6e38cae (diff) | |
download | numpy-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.rst | 10 |
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 |