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
API: DataFrame.__getitem__ returns Series for sparse column
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.
closespandas-dev#23559
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.24.0.txt
+1
Original file line number
Diff line number
Diff line change
@@ -560,6 +560,7 @@ changes were made:
560
560
- The result of concatenating a mix of sparse and dense Series is a Series with sparse values, rather than a ``SparseSeries``.
561
561
- ``SparseDataFrame.combine`` and ``DataFrame.combine_first`` no longer supports combining a sparse column with a dense column while preserving the sparse subtype. The result will be an object-dtype SparseArray.
562
562
- Setting :attr:`SparseArray.fill_value` to a fill value with a different dtype is now allowed.
563
+
- ``DataFrame[column]`` is now a :class:`Series` with sparse values, rather than a :class:`SparseSeries`, when slicing a single column with sparse values (:issue:`23559`).
563
564
564
565
Some new warnings are issued for operations that require or are likely to materialize a large dense array:
0 commit comments