Just iterate over the transposed of your array:

for column in array.T:
   some_function(column)
Answer from tillsten on Stack Overflow
🌐
W3Schools
w3schools.com β€Ί python β€Ί numpy β€Ί numpy_array_iterating.asp
NumPy Array Iterating
Iterate on the elements of the following 1-D array: import numpy as np arr = np.array([1, 2, 3]) for x in arr: print(x) Try it Yourself Β» Β· In a 2-D array it will go through all the rows.
🌐
TutorialsPoint
tutorialspoint.com β€Ί numpy β€Ί numpy_iterating_over_array.htm
NumPy - Iterating Over Array
NumPy provides options to control the iteration order based on memory layout and performance considerations βˆ’ Β· Fortran-style Order βˆ’ Iterates over elements column-wise (column-major order).
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί iterating through a numpy array
r/learnpython on Reddit: Iterating through a numpy array
November 14, 2014 -

I know this is a dumb question, but I've scoured Google for the documentation, Stack Overflow, etc. but I can't figure out how to do this. I'm really used to C so I might be approaching this wrong.

Basically, I have a multidimensional array; specifically, it's n x 2. Another way of looking at it is that it's an array of tuples.

So suppose there are the points (1, 9), (2, 8), and (3, 7).

Now, my assumption is that [[1, 2, 3], [9, 8, 7]] is an nx2 array, and that [[1,9], [2, 8], [3, 7]] is a 2xn array, correct?

So my question is, in each case (given an nx2 and a 2xn array), how would I iterate through each ordered pair?

🌐
Reddit
reddit.com β€Ί r/python β€Ί numpy: iterate over columns
r/Python on Reddit: Numpy: Iterate over Columns
December 14, 2017 -

Hey,

I'm fairly new to Python and Numpy, but I have a reoccuring problem: I have a transformation matrix (as a numpy array) with a shape of (2,2) and a numpy array (shape(2,i)) with a lot of points I want to transform. In order to transform I need to get every column and multiply the transformation matrix with the column and then save the result in numpy array. I'm able to iterate over every column, however that doesn't look like the pythonic way to do it. Is there a short command or pythonic way?

🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί numpy-iterating-over-array
Numpy - Iterating Over Arrays - GeeksforGeeks
July 23, 2025 - It allows iteration in different orders and provides better control over the iteration process. Python Β· import numpy as np # Using nditer arr = np.array([[1, 2], [3, 4]]) for element in np.nditer(arr): print(element) Output Β· 1 2 3 4 Β· We can also specify the order of iteration (row-major order 'C' or column-major order 'F'): Python Β·
🌐
NumPy
numpy.org β€Ί doc β€Ί stable β€Ί reference β€Ί arrays.nditer.html
Iterating over arrays β€” NumPy v2.5 Manual
The nditer object provides an order parameter to control this aspect of iteration. The default, having the behavior described above, is order=’K’ to keep the existing order. This can be overridden with order=’C’ for C order and order=’F’ for Fortran order.
🌐
Python Like You Mean It
pythonlikeyoumeanit.com β€Ί Module3_IntroducingNumpy β€Ί ArrayTraversal.html
Iterating Over Arrays & Array-Traversal Order β€” Python Like You Mean It
Row-major ordering (C ordering) {NumPy’s default}: traverse an array by advancing the index of the last axis, first, until the end of that axis is reached, and then advance the index of the second-to last axis, and so on. Column-major ordering (F ordering): traverse an array by advancing the index of the first axis, first, until the end of that axis is reached, and then advance the index of the second axis, and so on.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί python-iterate-over-columns-in-numpy
Python - Iterate over Columns in NumPy - GeeksforGeeks
February 26, 2023 - Then we transposed the array, using ary.T which in turn switches the rows with the columns and columns with the rows. Then we iterated over each row of this transposed array and printed the row values.
🌐
MindStick
mindstick.com β€Ί interview β€Ί 34411 β€Ί how-to-iterating-numpy-array
How to Iterating NumPy Array? – MindStick
November 12, 2025 - import numpy as np arr = np.array([1, 2, 3, 4, 5]) for x in arr: print(x) ... You can convert elements while iterating, e.g. from int to float: for x in np.nditer(arr, flags=['buffered'], op_dtypes=['float']): print(x) ... arr = np.array([[1, ...
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί how do i iterate over rows and columns? can't find a tutorial on it.
r/learnpython on Reddit: How do I iterate over rows and columns? Can't find a tutorial on it.
October 26, 2023 -

The problem I want to solve is this- I want to find a certain item in a list that is formatted like a chart, something like this:

list=[1,2,3,4,5
      2,4,6,8,10
      3,6,9,12,16
      4,8,12,16,20
      5,10,15,20,25]

So I want to be able to call values within this makeshift chart. For instance, if I wanted to call a certain value within this list like--- Row 2, column 3.... this would return 6.

I think this can be done with iterations???? I saw a video of it somewhere but I can't find anything on google about this, I think I just don't know how to explain it. How do I do what I want to do in python 3+, without using panda?

Would really appreciate some code, but if you can just tell me what I should look up to learn how to do this, it would help just as much! Thanks!!!!

🌐
Tutorial Reference
tutorialreference.com β€Ί python β€Ί examples β€Ί faq β€Ί python-numpy-how-to-iterate-over-columns-of-numpy-array
Python NumPy: How to Iterate Over the Columns of an Array | Tutorial Reference
Iterating over the rows of transposed_array gives you the columns of array_2d. You can iterate through the column indices and use NumPy's slicing to extract each column.
🌐
Scaler
scaler.com β€Ί home β€Ί topics β€Ί numpy β€Ί numpy iterating over array
NumPy Iterating Over Array - Scaler Topics - Scaler Topics
September 9, 2022 - However, we have to perform multiple loops to iterate over a multidimensional array. To avoid using multiple loops, we use a NumPy function called nditer. The nditer function is used for iterating each array element in a single iteration. Let's look at the following examples where an array ...
🌐
TutorialsPoint
tutorialspoint.com β€Ί article β€Ί how-to-iterate-over-columns-in-numpy
How to iterate over Columns in Numpy
March 27, 2026 - You can manually iterate through columns using array indexing and the shape property ? import numpy as np # Create a 3x3 array arr = np.array([[1, 5, 9], [13, 14, 21], [25, 29, 33]]) # Get the number of columns num_cols = arr.shape[1] print("Manual iteration over columns:") # Iterate through each column index for col_index in range(num_cols): col = arr[:, col_index] # Extract column print(f"Column {col_index}: {col}")
🌐
NumPy
numpy.org β€Ί doc β€Ί 2.1 β€Ί reference β€Ί arrays.nditer.html
Iterating over arrays β€” NumPy v2.1 Manual
The nditer object provides an order parameter to control this aspect of iteration. The default, having the behavior described above, is order=’K’ to keep the existing order. This can be overridden with order=’C’ for C order and order=’F’ for Fortran order.
🌐
NumPy
numpy.org β€Ί doc β€Ί 2.2 β€Ί reference β€Ί arrays.nditer.html
Iterating over arrays β€” NumPy v2.2 Manual
The nditer object provides an order parameter to control this aspect of iteration. The default, having the behavior described above, is order=’K’ to keep the existing order. This can be overridden with order=’C’ for C order and order=’F’ for Fortran order.
🌐
Pluralsight
pluralsight.com β€Ί blog β€Ί tech guides & tutorials
Iterating Numpy Arrays | Pluralsight
November 12, 2018 - To iterate each cell in the ... a one-dimensional array. For example: ... NumPy provides a multi-dimensional iterator object called nditer to iterate the elements of an array....