What if we try to reshape an array with 8 elements into a 3x3 matrix

What if we try to reshape an array with 8 elements into a 3x3 matrix

Hi @Anuvrat99
We Reshape Into any Shape as long as the elements required for reshaping are equal in both shapes.We can reshape an 8 elements 1D array into 4 elements in 2 rows 2D array but we cannot reshape it into a 3 elements 3 rows 2D array as that would require 3x3 = 9 elements.

Hope this might helps :slightly_smiling_face:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.