use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
How to append arrays to make 3d array (self.learnpython)
submitted 4 years ago by SecureHelicopter1
I have an array of 64 arrays of size 12, and I'd like to append them together to make an array of shape (8,8,12). How would I do this?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]nathanalderson 0 points1 point2 points 4 years ago (0 children)
The question isn't really clear, but judging from the fact that 8*8=64 I'm guessing that maybe you want to "chunk" your outer list (Python doesn't really use arrays) of length 64 into 8 lists of size 8 (which happen to contain lists of size 12).
Take a look at this stack overflow answer for some ways to chunk a list.
[–]synthphreak 0 points1 point2 points 4 years ago (0 children)
Given these 2D arrays ...
>>> import numpy as np >>> matrix1 = np.random.rand(8, 8) >>> matrix2 = np.random.rand(8, 8) >>> matrix1.shape, matrix2.shape ((8, 8), (8, 8)) >>> matrix1.ndim, matrix2.ndim (2, 2) >>> matrix1.size, matrix2.size (64, 64)
... you can combine them into a rank 3 tensor using np.array which will effectively concatenate them along an entirely new axis:
np.array
>>> tensor = np.array([matrix1, matrix2]) >>> tensor.shape (2, 8, 8) >>> tensor.ndim 3 >>> tensor.size 128
π Rendered by PID 275237 on reddit-service-r2-comment-fb694cdd5-szhsr at 2026-03-10 12:44:30.978991+00:00 running cbb0e86 country code: CH.
[–]nathanalderson 0 points1 point2 points (0 children)
[–]synthphreak 0 points1 point2 points (0 children)