Python | Numpy matrix.flatten()
With the help of
Numpy matrix.flatten() method, we are able to
flatten of a given matrix and gives output as one dimensional 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 : Return flatten 1-D matrix
Example #1 :
In this example we can see that with the help of
matrix.flatten() method we are able to flatten a given matrix.
[[6 2 3]]
Example #2 :
[[1 2 3 4 5 6 7 8 9]]