Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Chemistry
Biology and Medical
Earth Sciences
Computer Science
Computing and Technology
DIY Projects
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Other Sciences
Programming and Computer Science
Why are new dimensions added to the left in numpy arrays?
Reply to thread
Message
[QUOTE="fog37, post: 6461699, member: 503639"] [B]TL;DR Summary:[/B] 3D numpy array indices and array shape Hello, I am clear on 1D and 2D Numpy arrays, how to create them and address them). [LIST] [*]1D array: single list [*]2D array: list containing multiple lists as elements [*]3D array: list containing lists which contain lists as elements [/LIST] Array elements can be address using indices as a[], a[][], a[][][] respectively. I have a question about 3D arrays like the one below: [ATTACH type="full" width="285px" alt="1614297403478.png"]278665[/ATTACH] I would say that it is a 2x4x3 array but that is not correct when I use the command[CODE=python]array_example.shape[/CODE]. The result is (3,2,4). My understanding is that shape should give (row, column, layer). My interpretation is that it is a 3D array composed of 3 identical 2x4 2D arrays [ATTACH type="full" width="159px" alt="1614297608807.png"]278667[/ATTACH] The command shape seem have the first integer in the tuple (, , ) represents the number of layers of the 3D array instead.. Thanks for any advice. [/QUOTE]
Insert quotes…
Post reply
Forums
Other Sciences
Programming and Computer Science
Why are new dimensions added to the left in numpy arrays?
Back
Top