## 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-592aec5a34a56401050295/] 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-592aec5a34a6a323443321/] 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) [...]