Skip to content

Commit 6904c23

Browse files
TomAugspurgerjreback
authored andcommitted
DOC: sparse doc fixups (#26571)
1 parent 3628e18 commit 6904c23

File tree

7 files changed

+10
-3
lines changed

7 files changed

+10
-3
lines changed

doc/source/user_guide/sparse.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ have no replacement.
269269
Interaction with scipy.sparse
270270
-----------------------------
271271

272-
Use :meth:`DataFrame.sparse.from_coo` to create a ``DataFrame`` with sparse values from a sparse matrix.
272+
Use :meth:`DataFrame.sparse.from_spmatrix` to create a ``DataFrame`` with sparse values from a sparse matrix.
273273

274274
.. versionadded:: 0.25.0
275275

doc/source/whatsnew/v0.16.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Interaction with scipy.sparse
9292
Added :meth:`SparseSeries.to_coo` and :meth:`SparseSeries.from_coo` methods (:issue:`8048`) for converting to and from ``scipy.sparse.coo_matrix`` instances (see :ref:`here <sparse.scipysparse>`). For example, given a SparseSeries with MultiIndex we can convert to a `scipy.sparse.coo_matrix` by specifying the row and column labels as index levels:
9393

9494
.. ipython:: python
95+
:okwarning:
9596
9697
s = pd.Series([3.0, np.nan, 1.0, 3.0, np.nan, np.nan])
9798
s.index = pd.MultiIndex.from_tuples([(1, 2, 'a', 0),
@@ -121,6 +122,7 @@ The from_coo method is a convenience method for creating a ``SparseSeries``
121122
from a ``scipy.sparse.coo_matrix``:
122123

123124
.. ipython:: python
125+
:okwarning:
124126
125127
from scipy import sparse
126128
A = sparse.coo_matrix(([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])),

doc/source/whatsnew/v0.18.1.rst

+2
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ used in the ``pandas`` implementation (:issue:`12644`, :issue:`12638`, :issue:`1
394394
An example of this signature augmentation is illustrated below:
395395

396396
.. ipython:: python
397+
:okwarning:
397398
398399
sp = pd.SparseDataFrame([1, 2, 3])
399400
sp
@@ -409,6 +410,7 @@ Previous behaviour:
409410
New behaviour:
410411

411412
.. ipython:: python
413+
:okwarning:
412414
413415
np.cumsum(sp, axis=0)
414416

doc/source/whatsnew/v0.19.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1236,6 +1236,7 @@ Operators now preserve dtypes
12361236
- Sparse data structure now can preserve ``dtype`` after arithmetic ops (:issue:`13848`)
12371237

12381238
.. ipython:: python
1239+
:okwarning:
12391240
12401241
s = pd.SparseSeries([0, 2, 0, 1], fill_value=0, dtype=np.int64)
12411242
s.dtype
@@ -1245,6 +1246,7 @@ Operators now preserve dtypes
12451246
- Sparse data structure now support ``astype`` to convert internal ``dtype`` (:issue:`13900`)
12461247

12471248
.. ipython:: python
1249+
:okwarning:
12481250
12491251
s = pd.SparseSeries([1., 0., 2., 0.], fill_value=0)
12501252
s

doc/source/whatsnew/v0.20.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ See the :ref:`documentation <sparse.scipysparse>` for more information. (:issue:
339339
All sparse formats are supported, but matrices that are not in :mod:`COOrdinate <scipy.sparse>` format will be converted, copying data as needed.
340340

341341
.. ipython:: python
342+
:okwarning:
342343
343344
from scipy.sparse import csr_matrix
344345
arr = np.random.random(size=(1000, 5))

pandas/core/sparse/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class SparseDataFrame(DataFrame):
4242
DataFrame containing sparse floating point data in the form of SparseSeries
4343
objects
4444
45-
.. deprectaed:: 0.25.0
45+
.. deprecated:: 0.25.0
4646
4747
Use a DataFrame with sparse values instead.
4848

pandas/core/sparse/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
class SparseSeries(Series):
4747
"""Data structure for labeled, sparse floating point data
4848
49-
.. deprectaed:: 0.25.0
49+
.. deprecated:: 0.25.0
5050
5151
Use a Series with sparse values instead.
5252

0 commit comments

Comments
 (0)