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
- Shape and Reshape
- Discussions
Shape and Reshape
Shape and Reshape
Sort by
recency
|
376 Discussions
|
Please Login in order to post a comment
For Python3 Platform
def reshape(arr): arr1 = numpy.array(arr) res = numpy.reshape(arr1,(3,3)) return res
arr = list(map(int,input().split())) print(reshape(arr))
import numpy import sys
chars = sys.stdin.read().split() arr = numpy.array([int(char) for char in chars]) arr.shape = (3,3) print(arr)
import numpy
arr=list(map(int,input().split()))
change_array=numpy.array(arr) change_array=change_array.reshape(3,3) print(change_array)