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
|
330 Discussions
|
Please Login in order to post a comment
import numpy
n,m=map(int,input().split()) matrix=[] for i in range(n): matrix.append(list(map(int, input().split())))
array=numpy.array(matrix) print(numpy.transpose(array)) print(array.flatten())
With the help of regEx :
For Python3