I have a matrix and I want to check if it is sparse or not.
Things I have tried:
isinstance method:
if isinstance(<matrix>, scipy.sparse.csc.csc_matrix):
This works fine if I know exactly which sparse class I want to check.
But I want a way to know if matrix is sparse or not, and should work irrespective of which sparse class.
Kindly help me.
scipy.sparse.issparse(my_matrix)