Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8366827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:00:41+00:00 2026-06-09T13:00:41+00:00

very new to python so attempting to wrap my head around multi dimensional arrays.

  • 0

very new to python so attempting to wrap my head around multi dimensional arrays. I read the existing posts and most of them deal with multi dimensional arrays given dimensions. In my case, I do not have dimensions for the total number of rows possible. A file is being processed, which is CSV and has 7 columns, but each line, depending on meeting or failing a criteria is accordingly drafted into an array. Essentially each line has 7 columns, but the number of rows cannot be predicted. The line is being treated as a list.

My aim is to create a multidimensional array of eligible lines and then be able to access values in the array. how can I do this?

essentially, how do I tackle creating a 2D list:

list_2d = [[foo for i in range(m)] for j in range(n)]

The above creates an mxn sized list but in my case, I know only n (columns) and not m(rows)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:00:42+00:00Added an answer on June 9, 2026 at 1:00 pm

    Nest lists in lists you don’t need to predefine the length of a list to use it and you can append on to it. Want another dimension simply append another list to the inner most list.

    [[[a1, a2, a3]  , [b1, b2, b3] , [c1, c2, c3]],
    [[d1, d2, d3]  , [e1, e2, e3] , [f1, f2, f3]]]
    

    and to use them easily just look at Nested List Comprehensions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to Python, I need to read numbers from a file
I am very new to Python. I need to have a 3 dimensional matrix,
Very new to python and can't understand why this isn't working. I have a
I very new to Python, and fairly new to regex. (I have no Perl
I am a very new in Python so please forgive me the basic question.
I am very new to python programming and have yet to buy a textbook
I'm very new to Python and I'm sure there is a much easier way
I am very new to Python and I have a json news feed that
I'm very new to Python development, and am having a problem with one of
I'm very new to Python and just crawling my way through it to accomplish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.