About this course
The question is how reshaping operations work? Above we had the matrix $mathbf{A}$ of size $(3,4)$ with 12 ($3 times 4$) total elements. When we use np.reshape , the default Numpy order is “C-style” , which is, the rightmost index “changes the fastest” for the processing operation. Let's use the above example of using .ravel() to flatten the matrix: The first element is obviously $mathbf{A}_{0,0}$ and the next one is $mathbf{A}_{0,1}$. The processing and creating the new array is as below when using .ravel() :
$$ [ mathbf{A}_{0,0}, mathbf{A}_{0,1}, mathbf{A}_{0,2}, mathbf{A}_{0,3}, mathbf{A}_{1,0}, cdots, mathbf{A}_{3,3}, mathbf{A}_{3,4} ]$$