Transpose and Flatten

  • + 0 comments
    import numpy as np
    
    n, m = map(int, input().split())
    matrix = np.array([list(map(int, input().split())) for _ in range(n)])
    print(np.transpose(matrix))
    print(matrix.flatten())