summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
authorChristopher Dahlin <christopher@tracsense.tech>2021-03-28 15:07:29 +0200
committerChristopher Dahlin <christopher@tracsense.tech>2021-03-28 15:07:29 +0200
commitddff4415d195ff18cebe565e3538b4690299021d (patch)
treea6d0ee6b4c2b776a73ec4c8b8843d0f64c97800e /doc/source
parent18db7880daf6cd20bd7539ab65a3f06663f10d90 (diff)
parentd0794c94932d349d045e773c54c7b0d3d24eebfe (diff)
downloadnumpy-ddff4415d195ff18cebe565e3538b4690299021d.tar.gz
Merge branch 'main' of https://github.com/cdahlin/numpy into absolute-beginner-doc-clarification
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/user/absolute_beginners.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/source/user/absolute_beginners.rst b/doc/source/user/absolute_beginners.rst
index 53be9aca8..084bb6d22 100644
--- a/doc/source/user/absolute_beginners.rst
+++ b/doc/source/user/absolute_beginners.rst
@@ -884,7 +884,8 @@ Indexing and slicing operations are useful when you're manipulating matrices::
>>> data[0, 1]
2
>>> data[1:3]
- array([[3, 4]])
+ array([[3, 4],
+ [5, 6]])
>>> data[0:2, 0]
array([1, 3])
@@ -893,11 +894,11 @@ Indexing and slicing operations are useful when you're manipulating matrices::
You can aggregate matrices the same way you aggregated vectors::
>>> data.max()
- 4
+ 6
>>> data.min()
1
>>> data.sum()
- 10
+ 21
.. image:: images/np_matrix_aggregation.png
@@ -905,9 +906,9 @@ You can aggregate all the values in a matrix and you can aggregate them across
columns or rows using the ``axis`` parameter::
>>> data.max(axis=0)
- array([3, 4])
+ array([5, 6])
>>> data.max(axis=1)
- array([2, 4])
+ array([2, 4, 6])
.. image:: images/np_matrix_aggregation_row.png