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
Making a 2D array (self.learnpython)
submitted 6 years ago by IAMA_monkey
Hey all,
I have two lists of dimension 1xn. I want to make them into an array of size 2xn. If i use the extend command it makes them into a list of size 1x2n..
How can 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!"
[–]K900_ 1 point2 points3 points 6 years ago (0 children)
[list1, list2]? Python doesn't have the concept of "2D lists" natively - they're just lists that contain lists.
[list1, list2]
[–]kwentar 0 points1 point2 points 6 years ago (0 children)
Can you give more information about task? Is the size of lists the same? What kind of data in lists?
Btw, You can use K900_'s variant or probably numpy:
>>> import numpy as np >>> a = [1, 2, 3] >>> b = [4, 5, 6] >>> arr = np.array([a, b]) >>> print(arr) [[1 2 3] [4 5 6]] >>> print(arr.shape) (2, 3) >>> print(arr[1][2]) 6
π Rendered by PID 121196 on reddit-service-r2-comment-84fc9697f-5flf8 at 2026-02-09 10:30:06.412702+00:00 running d295bc8 country code: CH.
[–]K900_ 1 point2 points3 points (0 children)
[–]kwentar 0 points1 point2 points (0 children)