You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is why I initially added docs on how to filter the warnings :)
So we can either add the once filter ourselves, or we can do some finer-grained filters in places like __repr__. Do you have a preference? All else equal, I'd just add a once filter in pandas/__init__.py since it's less work.
0
foo.py:7: FutureWarning: SparseDataFrame is deprecated and will be removed in a future version.
Use a regular DataFrame whose columns are SparseArrays instead.
See http://pandas.pydata.org/pandas-docs/stable/user_guide/sparse.html#migrating for more.
pd.SparseDataFrame({"A": []})
1
foo.py:7: FutureWarning: SparseDataFrame is deprecated and will be removed in a future version.
Use a regular DataFrame whose columns are SparseArrays instead.
See http://pandas.pydata.org/pandas-docs/stable/user_guide/sparse.html#migrating for more.
pd.SparseDataFrame({"A": []})
0
1
Not much we can do about that. Which leaves us with finer-grained filters. I'll make a PR for the repr, but I don't think I'll go beyond that.
Closing this. The repr has been fixed, operations that create new SparseDataFrame/Series under the hood probably not. If somebody cares enough we are open for a fix.
If you are still using the SparseDataFrame class, the warnings are quite sticky:
So they are also raised each time you display them (repr), on each operation (like the addition I did).
I know users can filter them, but ideally they would be shown a bit less I think to not annoy users too much.
cc @TomAugspurger
The text was updated successfully, but these errors were encountered: