We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Numpy
- Transpose and Flatten
- Discussions
Transpose and Flatten
Transpose and Flatten
Sort by
recency
|
309 Discussions
|
Please Login in order to post a comment
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)