Home > Article > Backend Development > How to operate Python to traverse numpy array
This time I will bring you how to operatePythonTraverse numpyarray, what are the notes when operating Python to traverse numpy array, the following is a practical case, Let’s take a look.
When using python for image processing, sometimes it is necessary to traverse the numpy array. The following is the method of traversing the array:
[rows, cols] = num.shape for i in range(rows - 1): for j in range(cols-1): print(num[j, i])
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
How to obtain the local peak value of a two-dimensional array in python
How to use OpenCV with the Python interface
The above is the detailed content of How to operate Python to traverse numpy array. For more information, please follow other related articles on the PHP Chinese website!