Monday, 29 September 2025

Math ABC: Visualizing, Indexing, and Slicing Matrices

Matrices can be conceptualized as a set of column vectors stacked next to each other (e.g., a data table of observations-by-features), as a set of row vectors layered on top of each other (e.g., multisensor data in which each row is a time series from a different channel), or as an ordered collection of individual matrix elements (e.g., an image in which each matrix element encodes pixel intensity value).

Larger matrices can be visualized as images. The numerical value of each element of the matrix maps onto a color in the image. In most cases, the maps are pseudo-colored because the mapping of numerical value onto color is arbitrary. Matrices can be visualized as images using the Python library matplotlib.

Extracting a subset of rows or columns of a matrix is done through slicing.





References

Cohen, Mike X. Practical Linear Algebra for Data Science (p. 103). O'Reilly Media. Kindle Edition. 

No comments:

Post a Comment