## How to convert multiple matrices into one single vector in Python?

This is a quick post on how to convert multiple matrices into a single vector using Python's numpy package. To begin with let us define 2 matrices. [crayon-5a88e9349db06152549519/] What we want to do is to merge the contents of mat1 and mat2 into a single vector. To reach that goal first we need to convert each of them into vectors. For this we will make use of Numpy's reshape. [crayon-5a88e9349db19126975551/] The -1 value for the newshape parameter of reshape ensures that the output has only 1 dimension. A matrix with 1 dimension is called a vector, which is what we want to achieve. Now that we have flattened both the matrices, we can merge (concatenate) [...]