Python Forum
Numpy Quick start Tutorial - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Numpy Quick start Tutorial (/thread-15844.html)



Numpy Quick start Tutorial - leodavinci1990 - Feb-03-2019

Please look at text below which is from the NumPy tutorial. Shouldn't it say that the 1st axes have a length of 3 since it has 3 elements instead of 2? if not please explain.




In the example pictured below, the array has 2 axes. The first axis has a length of 2, the second axis has a length of 3.

[[ 1., 0., 0.],
[ 0., 1., 2.]]


RE: Numpy Quick start Tutorial - buran - Feb-03-2019

First axe has a length of 2, i.e. there are 2 elements - that is there are 2 elements in the outer list
Second axe has a length of 3 - that is each of the inner lists has 3 elements

If you prefer - there are 2 rows and 3 columns (you can see that from the way you presented the array)