Converting between formats
📖 Scenario: You work in a data science team that uses sparse matrices to save memory. Sparse matrices can be stored in different formats. You want to practice converting a sparse matrix from one format to another.
🎯 Goal: Create a sparse matrix in COO format, then convert it to CSR format, and finally print the CSR matrix.
📋 What You'll Learn
Create a COO sparse matrix with given data
Create a variable for the CSR format conversion
Convert the COO matrix to CSR format
Print the CSR matrix
💡 Why This Matters
🌍 Real World
Sparse matrices save memory when working with large datasets that have many zeros, such as text data or graphs.
💼 Career
Data scientists often convert between sparse matrix formats to optimize performance for different algorithms.
Progress0 / 4 steps