# get number of rows in 2D numpy array. numOfRows = np. size(arr2D, 0) # get number of columns in 2D numpy array. numOfColumns = np. size(arr2D, 1)
Here is what the above code is Doing:
1. np.size(arr2D, 0) returns the number of rows in the 2D numpy array.
2. np.size(arr2D, 1) returns the number of columns in the 2D numpy array.