Closed
Description
DataFrame.sparse.to_coo()
should raise when the fill_value
is not zero, since scipy.sparse
only supports filling with 0.
In [21]: df = pd.DataFrame({"A": pd.SparseArray([1, 1, 1, 2], fill_value=1)})
In [22]: df.sparse.to_coo().todense()
Out[22]:
matrix([[0],
[0],
[0],
[2]])
That's incorrect. It should instead raise a ValueError
with a nice message.