Skip to content

Commit 97da8bd

Browse files
committed
fixup! DOC: Document scipy sparse matrix accepted in SparseSeries constructor
1 parent 6bc8c8a commit 97da8bd

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

doc/source/sparse.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ To convert a ``SparseDataFrame`` back to sparse SciPy matrix in COO format, you
218218
SparseSeries
219219
~~~~~~~~~~~~
220220

221-
.. versionadded:: 0.20.2
221+
.. versionadded:: 0.21.0
222222

223223
``SparseSeries``, ``SparseArray`` can be constructed from ``scipy.sparse.spmatrix`` objects of shape ``(1, n)`` or ``(n, 1)``.
224224
SciPy sparse matrices can also be assigned directly to a ``SparseDataFrame`` with an index.

doc/source/whatsnew/v0.20.2.txt

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ Enhancements
2525
has been added to return the group order (:issue:`11642`); see
2626
:ref:`here <groupby.ngroup>`.
2727

28-
29-
- ``SparseSeries`` and ``SparseArray`` now support 1d ``scipy.sparse.spmatrix`` in constructor. Additionally, ``SparseDataFrame`` can be assigned columns of ``scipy.sparse.spmatrix``; see :ref:`here <sparse.scipysparse_series>`. (:issue:`15634`)
30-
3128
.. _whatsnew_0202.performance:
3229

3330
Performance Improvements

doc/source/whatsnew/v0.21.0.txt

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ New features
2525
- Added `__fspath__` method to :class`:pandas.HDFStore`, :class:`pandas.ExcelFile`,
2626
and :class:`pandas.ExcelWriter` to work properly with the file system path protocol (:issue:`13823`)
2727

28+
- ``SparseSeries`` and ``SparseArray`` now support 1d ``scipy.sparse.spmatrix`` in constructor.
29+
Additionally, ``SparseDataFrame`` can be assigned columns of ``scipy.sparse.spmatrix``;
30+
see :ref:`here <sparse.scipysparse_series>`. (:issue:`15634`)
31+
2832
.. _whatsnew_0210.enhancements.other:
2933

3034
Other Enhancements

pandas/core/sparse/series.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,9 @@ def combine_first(self, other):
726726

727727
def to_coo(self, row_levels=(0, ), column_levels=(1, ), sort_labels=False):
728728
"""
729-
DEPRECATED; instead, make a SparseSeries with a two-level index,
730-
unstack it, then use .to_coo() on the resulting SparseDataFrame.
729+
.. deprecated:: 0.21.0
730+
Instead, make a SparseSeries with a two-level index,
731+
unstack it, then use .to_coo() on the resulting SparseDataFrame.
731732
732733
Create a scipy.sparse.coo_matrix from a SparseSeries with MultiIndex.
733734
@@ -786,8 +787,9 @@ def to_coo(self, row_levels=(0, ), column_levels=(1, ), sort_labels=False):
786787
@classmethod
787788
def from_coo(cls, A, dense_index=False):
788789
"""
789-
DEPRECATED; instead, pass 1d scipy.sparse matrices directly into
790-
SparseSeries constructor, and 2d into SparseDataFrame constructor.
790+
.. deprecated:: 0.21.0
791+
Instead, pass 1d scipy.sparse matrices directly into SparseSeries
792+
constructor, and 2d into SparseDataFrame constructor.
791793
792794
Create a SparseSeries from a scipy.sparse.coo_matrix.
793795

0 commit comments

Comments
 (0)