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
|
297 Discussions
|
Please Login in order to post a comment
import numpy
s = list(map(int, input().split())) matrix = []
for _ in range(s[0]): matrix.append(list(map(int, input().split())))
my_array = numpy.array(matrix) print(numpy.transpose(my_array)) print(my_array.flatten())