Python | Numpy matrix.reshape()
With the help of
Numpy matrix.reshape() method, we are able to reshape the shape of the given matrix. Remember all elements should be covered after reshaping the given matrix.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Return: new reshapped matrix
Example #1 :
In the given example we are able to reshape the given matrix by using
[[64 1 12 3]]
Example #2 :
[[1 2 4] [5 7 8]]