Shape and Reshape

Sort by

recency

|

367 Discussions

|

  • + 0 comments
    import numpy as np
    s = np.array(list((map(int, input().split()))))
    print(np.reshape(s, (3,3)))
    
  • + 0 comments
    import numpy
    c = input()
    a = numpy.array(list(map(int,c.split())))
    print(a.reshape((3,3)))
    
  • + 0 comments
    import numpy as np
    a = np.array(list(map(int, input().split())))
    a.shape = (3, 3)
    print(a)
    
  • + 0 comments

    import numpy as np arr = list(map(int, input().split())) arr = np.array(arr) print(np.reshape(arr,(3,3)))

  • + 0 comments
    import numpy as np
    
    n = list(map(int, input().split()))
    arr = np.array(n)
    print(arr.reshape(3,3))