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
|
382 Discussions
|
Please Login in order to post a comment
import numpy as np
user_list = list(map(int,input().split()))
print(np.reshape(user_list,(3,3)))
Here is HackerRank Shape and Reshape in Python solution - https://programmingoneonone.com/hackerran-shape-and-reshape-problem-solution-in-python.html
import numpy user_input = input().split() user_input = numpy.array(user_input,dtype = 'int') print(numpy.reshape(user_input,(3,3)))
Check this out :)
import numpy
inp=list(map(int,input().split())) change_array=numpy.array(inp) change_array.shape=(3,3) print(change_array)