-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API/DEPR: deprecate SparseSeries.from_coo and accept in constructor #15634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
cc @kernc |
So how would this work? The exact same functionality as currently in >>> spm = scipy.sparse.coo_matrix(np.eye(5))
>>> pd.SparseSeries.from_coo(spm)
0 0 1.0
1 1 1.0
2 2 1.0
3 3 1.0
4 4 1.0
dtype: float64
BlockIndex
Block locations: array([0], dtype=int32)
Block lengths: array([5], dtype=int32)
>>> pd.SparseSeries.from_coo(spm.tocsr()[0].tocoo()) # first row only
0 0 1.0
dtype: float64
BlockIndex
Block locations: array([0], dtype=int32)
Block lengths: array([1], dtype=int32)
>>> pd.SparseDataFrame(spm).iloc[0] # first row sliced from df
0 1.0
1 NaN
2 NaN
3 NaN
4 NaN
Name: 0, dtype: float64
BlockIndex
Block locations: array([0], dtype=int32)
Block lengths: array([1], dtype=int32) |
Looking at this again, I think we should just fully deprecate this method. You can do the exact same thing with I could see Maybe have a read in the original issue and see that the use was. |
But that's an implementation detail of what is generally an arbitrary n-d structure.
All scipy sparse matrces are
|
@kernc yeah the more I look at this the more I think we should just remove these from |
yes; to the extent that something is a true bug fix or simply an enhancement it can go in a point release (e.g. 0.20.1) |
xref #15497
using
SparseDataFrame
as the model.The text was updated successfully, but these errors were encountered: