About 107,000 results
Open links in new tab
  1. python - How to define a two-dimensional array? - Stack Overflow

    Jul 12, 2011 · I want to define a two-dimensional array without an initialized length like this: Matrix = [][] But this gives an error: IndexError: list index out of range

  2. How to initialize a two-dimensional array (list of lists, if not using ...

    numpy provides a multidimensional array type. Building a good multidimensional array out of lists is possible but less useful and harder for a beginner than using numpy. Nested lists are great …

  3. Two dimensional array in python - Stack Overflow

    2 When constructing multi-dimensional lists in Python I usually use something similar to ThiefMaster's solution, but rather than appending items to index 0, then appending items to …

  4. python - 2d array of zeros - Stack Overflow

    There is no array type in python, but to emulate it we can use lists. I want to have 2d array-like structure filled in with zeros. My question is: what is the difference, if any, in this two expres...

  5. Multi dimensional arrays in Python of a dynamic size

    Aug 14, 2012 · 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 …

  6. Initialising an array of fixed size in Python - Stack Overflow

    I would like to know how i can initialize an array(or list), yet to be populated with values, to have a defined size. For example in C: int x[5]; /* declared without adding elements*/ How do I do ...

  7. How to define a global array in python - Stack Overflow

    Sep 16, 2016 · In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a new value anywhere within the function’s body, it’s assumed to be a …

  8. Declaring and populating 2D array in python - Stack Overflow

    Sep 27, 2013 · Declaring and populating 2D array in python Asked 12 years ago Modified 7 years, 6 months ago Viewed 43k times

  9. How do I create an empty array and then append to it in NumPy?

    I want to create an empty array and append items to it, one at a time. xs = [] for item in data: xs.append(item) Can I use this list-style notation with NumPy arrays?

  10. How to input matrix (2D list) in Python? - Stack Overflow

    Mar 19, 2019 · Related: Creating a 2D array from a single list of input integers separated by space – Georgy Jul 12, 2019 at 10:10 Related: How to create a 2D list from user input with separate …