About 125,000 results
Open links in new tab
  1. How to initialize a two-dimensional array (list of lists, if not using ...

    I'm beginning python and I'm trying to use a two-dimensional list, that I initially fill up with the same variable in every place. I came up with this: def initialize_twodlist(foo): twod_list ...

  2. python - How to define a two-dimensional array? - Stack Overflow

    Jul 12, 2011 · Coming from other languages: it IS a difference between an 1D-Array containing 1D-Arrays and a 2D-Array. And AFAIK there is no way of having a multi-dimensional-array (or …

  3. python - How to create a multi-dimensional list - Stack Overflow

    May 9, 2020 · I want to initialize a multidimensional list. Basically, I want a 10x10 grid - a list of 10 lists each containing 10 items. Each list value should be initialized to the integer 0. The …

  4. Iterating over a 2 dimensional python list - Stack Overflow

    May 14, 2013 · Iterating over a 2 dimensional python list [duplicate] Asked 12 years, 6 months ago Modified 8 years, 5 months ago Viewed 519k times

  5. Rotating a two-dimensional array in Python - Stack Overflow

    In a program I'm writing the need to rotate a two-dimensional array came up. Searching for the optimal solution I found this impressive one-liner that does the job: rotated = zip(*original[::-1]) ...

  6. How to sum a 2d array in Python? - Stack Overflow

    May 23, 2012 · I want to sum a 2 dimensional array in python: Here is what I have:

  7. How do you extract a column from a multi-dimensional array?

    263 Could it be that you're using a NumPy array? Python has the array module, but that does not support multi-dimensional arrays. Normal Python lists are single-dimensional too. However, if …

  8. python - Pretty print 2D list? - Stack Overflow

    Is there a simple, built-in way to print a 2D Python list as a 2D matrix? So this:

  9. python - How do I sum the columns in 2D list? - Stack Overflow

    Aug 9, 2013 · How do I sum the columns in 2D list? Asked 15 years, 4 months ago Modified 6 years, 5 months ago Viewed 38k times

  10. Find length of 2D array Python - Stack Overflow

    May 23, 2012 · How do I find how many rows and columns are in a 2d array? For example, Input = ([[1, 2], [3, 4], [5, 6]])` should be displayed as 3 rows and 2 columns.