scipy.sparse.issparse
is used in this post.
Is it possible to specify your own distance function using scikit-learn K-Means Clustering?
However, I have no idea how it works. I already find the document, which is empty. http://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.issparse.html
from scipy.sparse import issparse
issparse([0, 0, 0])
>> False
issparse([[1, 0, 0], [0, 0, 0]])
>> False
It always return False
. How can I make it return True
?