Transpose a Vector or a Matrix

When working with one-dimensional array’s we use the term vector and a matrix is a term we use for the concept of storing matrices of more than one dimension.

Transposing, on the other hand, can have a significant impact on what a practitioner does when working with artificial intelligence and machine learning.

The transpose AT of a matrix A can be obtained by reflecting the elements along its main diagonal. Repeating the process on the transposed matrix returns the elements to their original position.

If you are interested in another approach to this topic you should check out this resource by Claus Fuhrer, Jan Erik Solem, and Olivier Verdier.

If you prefer to see how something similar to the above code could be implemented take a look at Noureddin’s video on NumPy’s Array Transposition on YouTube.

 

Further Reading

This section provides more resources on this topic if you are looking to go deeper.

Books


Python Machine Learning Got You Down?

Model in Minutes

…with a few simple lines of code.

Discover how in this new resource: Applied Machine Learning: A SciKit-Learn Approach

Learn by doing: loading data, visualizing, modeling, tuning, and much more…

Make Machine Learning Part of Your Projects, with ease.

Get the results you want today.

Click to learn more.