I have two pandas sparse dataframes, big_sdf and bigger_sdf.
When I try to multiply them:
result = big_sdf @ bigger_sdf
I get an error:
"numpy.core._exceptions.MemoryError: Unable to allocate 3.6 TiB for an array with shape (160815, 3078149) and data type int64"
So I tried to convert these sparse dataframes to SciPy's csr matrices and multiply it, but the conversion doesn't succeed:
from scipy.sparse import csr_matrix
csr_big = csr_matrix(big_sdf)
csr_bigger = csr_matrix(bigger_sdf)
When I run the last row I get an error message:
"ValueError: unrecognized csr_matrix constructor usage"
It only happens for the bigger matrix, the smaller one is converted with success.
Any ideas? Maybe there's a Pandas native method to multiply sparse dataframes which I missed?
Thanks in advance!