Understanding the CSR Sparse Matrix Format
TL;DR
In scientific computing and machine learning, we often work with sparse matrices, where most elements are zero. Storing such a matrix as a regular two-dimensional array wastes memory and can slow down computation. CSR (Compressed Sparse Row) is a classic format for solving this problem.
I had known the concept of CSR for a long time, but I never fully understood how it stores and reads data. After playing with an interactive demo, it finally clicked. I hope this helps others understand CSR more intuitively too.