I am trying to print the length (number of rows) of a CSR matrix, but the code is throwing the following error:
Traceback (most recent call last):
print("Number of records in the new dataset...{0}, {1}, {2}".format(len(X_new), len(Y_new), len(pids_new)))
File "/usr/local/lib64/python3.6/site-packages/scipy/sparse/base.py", line 295, in __len__
raise TypeError("sparse matrix length is ambiguous; use getnnz()"
TypeError: sparse matrix length is ambiguous; use getnnz() or shape[0]
How can I find the number of rows in the CSR matrix?