-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
ENH: implement clip for sparse structures #9265
Comments
you can directly implement So would love for:
|
This is probably still an issue with |
Yep, calling
Seems related to #21818? |
This works as intended now: >>> arr = pd.arrays.SparseArray([0,1,np.nan,3,4])
>>> pd.Series(arr).clip(1,2)
0 1.0
1 1.0
2 NaN
3 2.0
4 2.0
dtype: Sparse[float64, nan] Closing. |
Recognizing that this is probably not very high on the priority list, I'll document that a user tried to use clip on sparse structures and wished that it worked.
Some ideas for what to do in order of best to worst solution:
I am willing to submit PRs for 2 and 3, although I think that 3 is a bad idea. I need to understand the source better before I can consider volunteering to help with 1.
SparseSeries, SparseDataFrame, and SparsePanel all raise different exceptions.
The text was updated successfully, but these errors were encountered: