You are viewing a single comment's thread. Return to all comments →
import numpy as np
r,c = map(int, input().split()) arr = np.arange(1, (r*c)+1).reshape(r,c) arr1 = np.transpose(arr) arr2 = arr.flatten()
print(arr1) print(arr2)
Seems like cookies are disabled on this browser, please enable them to open this website
Transpose and Flatten
You are viewing a single comment's thread. Return to all comments →
import numpy as np
r,c = map(int, input().split()) arr = np.arange(1, (r*c)+1).reshape(r,c) arr1 = np.transpose(arr) arr2 = arr.flatten()
print(arr1) print(arr2)