-
-
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
DataFrame[sparse].__getitem__ should be Series, not SparseSeries #23559
Comments
Breaking API change for ```python In [1]: import pandas as pd In [2]: df = pd.DataFrame({"A": pd.SparseSeries([1, 0])}) In [3]: type(df['A']) Out[3]: pandas.core.sparse.series.SparseSeries ``` Now Out[3] is a Series. closes pandas-dev#23559
Breaking API change for ```python In [1]: import pandas as pd In [2]: df = pd.DataFrame({"A": pd.SparseSeries([1, 0])}) In [3]: type(df['A']) Out[3]: pandas.core.sparse.series.SparseSeries ``` Now Out[3] is a Series. closes pandas-dev#23559
FYI, these sparse-related PRs are all all working towards deprecating SparseDataFrame and SparseSeries. Being able to deprecate means we need to break API in a few places (like here) where the user has no control over the return type, unless we go with some kind of
the default of None warns, and returns a SparseSeries? Setting 'Series' will opt in to the future behavior? The strange thing about that is that if we're deprecating SparseSeries, you'll get a warning anyway with |
yeah this seems fine |
Can we break API here to return a Series[Sparse] instead?
cc @rkern
The text was updated successfully, but these errors were encountered: