You are viewing a single comment's thread. Return to all comments →
import numpy as np n = input() arr = list(map(int,n.split(' '))) main_arr = [] for i in range(arr[0]): m = input() arr1 = list(map(int,m.split(' '))) main_arr.append(arr1) main_arr = np.array(main_arr) print(np.transpose(main_arr)) print(main_arr.flatten())
import numpy as np
n = input()
arr = list(map(int,n.split(' '))) main_arr = [] for i in range(arr[0]): m = input() arr1 = list(map(int,m.split(' '))) main_arr.append(arr1)
main_arr = np.array(main_arr) print(np.transpose(main_arr)) print(main_arr.flatten())
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 →