Skip to content

Commit 2e9ece9

Browse files
author
Daniel Saxton
committed
Merge branch 'master' into cast-nat
2 parents 3445dc7 + 2b28454 commit 2e9ece9

File tree

123 files changed

+2924
-8955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2924
-8955
lines changed

ci/code_checks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
188188
set -o pipefail
189189
if [[ "$AZURE" == "true" ]]; then
190190
# we exclude all c/cpp files as the c/cpp files of pandas code base are tested when Linting .c and .h files
191-
! grep -n '--exclude=*.'{svg,c,cpp,html} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
191+
! grep -n '--exclude=*.'{svg,c,cpp,html,js} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print "##vso[task.logissue type=error;sourcepath=" $1 ";linenumber=" $2 ";] Tailing whitespaces found: " $3}'
192192
else
193-
! grep -n '--exclude=*.'{svg,c,cpp,html} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
193+
! grep -n '--exclude=*.'{svg,c,cpp,html,js} --exclude-dir=env -RI "\s$" * | awk -F ":" '{print $1 ":" $2 ":Tailing whitespaces found: " $3}'
194194
fi
195195
RET=$(($RET + $?)) ; echo $MSG "DONE"
196196
fi

doc/redirects.csv

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ generated/pandas.DataFrame.to_parquet,../reference/api/pandas.DataFrame.to_parqu
503503
generated/pandas.DataFrame.to_period,../reference/api/pandas.DataFrame.to_period
504504
generated/pandas.DataFrame.to_pickle,../reference/api/pandas.DataFrame.to_pickle
505505
generated/pandas.DataFrame.to_records,../reference/api/pandas.DataFrame.to_records
506-
generated/pandas.DataFrame.to_sparse,../reference/api/pandas.DataFrame.to_sparse
507506
generated/pandas.DataFrame.to_sql,../reference/api/pandas.DataFrame.to_sql
508507
generated/pandas.DataFrame.to_stata,../reference/api/pandas.DataFrame.to_stata
509508
generated/pandas.DataFrame.to_string,../reference/api/pandas.DataFrame.to_string
@@ -1432,7 +1431,6 @@ generated/pandas.Series.to_msgpack,../reference/api/pandas.Series.to_msgpack
14321431
generated/pandas.Series.to_numpy,../reference/api/pandas.Series.to_numpy
14331432
generated/pandas.Series.to_period,../reference/api/pandas.Series.to_period
14341433
generated/pandas.Series.to_pickle,../reference/api/pandas.Series.to_pickle
1435-
generated/pandas.Series.to_sparse,../reference/api/pandas.Series.to_sparse
14361434
generated/pandas.Series.to_sql,../reference/api/pandas.Series.to_sql
14371435
generated/pandas.Series.to_string,../reference/api/pandas.Series.to_string
14381436
generated/pandas.Series.to_timestamp,../reference/api/pandas.Series.to_timestamp

doc/source/reference/frame.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,7 @@ Serialization / IO / conversion
356356
DataFrame.to_msgpack
357357
DataFrame.to_gbq
358358
DataFrame.to_records
359-
DataFrame.to_sparse
360359
DataFrame.to_dense
361360
DataFrame.to_string
362361
DataFrame.to_clipboard
363362
DataFrame.style
364-
365-
Sparse
366-
~~~~~~
367-
.. autosummary::
368-
:toctree: api/
369-
370-
SparseDataFrame.to_coo

doc/source/reference/series.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -576,18 +576,7 @@ Serialization / IO / conversion
576576
Series.to_sql
577577
Series.to_msgpack
578578
Series.to_json
579-
Series.to_sparse
580579
Series.to_dense
581580
Series.to_string
582581
Series.to_clipboard
583582
Series.to_latex
584-
585-
586-
Sparse
587-
------
588-
589-
.. autosummary::
590-
:toctree: api/
591-
592-
SparseSeries.to_coo
593-
SparseSeries.from_coo

doc/source/user_guide/io.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,6 +4641,14 @@ Several caveats.
46414641

46424642
See the `Full Documentation <https://github.com/wesm/feather>`__.
46434643

4644+
.. ipython:: python
4645+
:suppress:
4646+
4647+
import warnings
4648+
# This can be removed once building with pyarrow >=0.15.0
4649+
warnings.filterwarnings("ignore", "The Sparse", FutureWarning)
4650+
4651+
46444652
.. ipython:: python
46454653
46464654
df = pd.DataFrame({'a': list('abc'),

doc/source/user_guide/sparse.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
Sparse data structures
77
**********************
88

9-
.. note::
10-
11-
``SparseSeries`` and ``SparseDataFrame`` have been deprecated. Their purpose
12-
is served equally well by a :class:`Series` or :class:`DataFrame` with
13-
sparse values. See :ref:`sparse.migration` for tips on migrating.
14-
159
Pandas provides data structures for efficiently storing sparse data.
1610
These are not necessarily sparse in the typical "mostly 0". Rather, you can view these
1711
objects as being "compressed" where any data matching a specific value (``NaN`` / missing value, though any value
@@ -168,6 +162,11 @@ the correct dense result.
168162
Migrating
169163
---------
170164

165+
.. note::
166+
167+
``SparseSeries`` and ``SparseDataFrame`` were removed in pandas 1.0.0. This migration
168+
guide is present to aid in migrating from previous versions.
169+
171170
In older versions of pandas, the ``SparseSeries`` and ``SparseDataFrame`` classes (documented below)
172171
were the preferred way to work with sparse data. With the advent of extension arrays, these subclasses
173172
are no longer needed. Their purpose is better served by using a regular Series or DataFrame with
@@ -366,12 +365,3 @@ row and columns coordinates of the matrix. Note that this will consume a signifi
366365
367366
ss_dense = pd.Series.sparse.from_coo(A, dense_index=True)
368367
ss_dense
369-
370-
371-
.. _sparse.subclasses:
372-
373-
Sparse subclasses
374-
-----------------
375-
376-
The :class:`SparseSeries` and :class:`SparseDataFrame` classes are deprecated. Visit their
377-
API pages for usage.

doc/source/whatsnew/v0.16.0.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ Interaction with scipy.sparse
9191

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

94-
.. ipython:: python
95-
:okwarning:
94+
.. code-block:: python
9695
9796
s = pd.Series([3.0, np.nan, 1.0, 3.0, np.nan, np.nan])
9897
s.index = pd.MultiIndex.from_tuples([(1, 2, 'a', 0),
@@ -121,8 +120,7 @@ Added :meth:`SparseSeries.to_coo` and :meth:`SparseSeries.from_coo` methods (:is
121120
The from_coo method is a convenience method for creating a ``SparseSeries``
122121
from a ``scipy.sparse.coo_matrix``:
123122

124-
.. ipython:: python
125-
:okwarning:
123+
.. code-block:: python
126124
127125
from scipy import sparse
128126
A = sparse.coo_matrix(([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])),

doc/source/whatsnew/v0.18.1.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,7 @@ used in the ``pandas`` implementation (:issue:`12644`, :issue:`12638`, :issue:`1
393393

394394
An example of this signature augmentation is illustrated below:
395395

396-
.. ipython:: python
397-
:okwarning:
396+
.. code-block:: python
398397
399398
sp = pd.SparseDataFrame([1, 2, 3])
400399
sp
@@ -409,8 +408,7 @@ Previous behaviour:
409408
410409
New behaviour:
411410

412-
.. ipython:: python
413-
:okwarning:
411+
.. code-block:: python
414412
415413
np.cumsum(sp, axis=0)
416414

doc/source/whatsnew/v0.19.0.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,8 +1235,7 @@ Operators now preserve dtypes
12351235

12361236
- Sparse data structure now can preserve ``dtype`` after arithmetic ops (:issue:`13848`)
12371237

1238-
.. ipython:: python
1239-
:okwarning:
1238+
.. code-block:: python
12401239
12411240
s = pd.SparseSeries([0, 2, 0, 1], fill_value=0, dtype=np.int64)
12421241
s.dtype
@@ -1245,8 +1244,7 @@ Operators now preserve dtypes
12451244
12461245
- Sparse data structure now support ``astype`` to convert internal ``dtype`` (:issue:`13900`)
12471246

1248-
.. ipython:: python
1249-
:okwarning:
1247+
.. code-block:: python
12501248
12511249
s = pd.SparseSeries([1., 0., 2., 0.], fill_value=0)
12521250
s

doc/source/whatsnew/v0.20.0.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,7 @@ See the :ref:`documentation <sparse.scipysparse>` for more information. (:issue:
338338

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

341-
.. ipython:: python
342-
:okwarning:
341+
.. code-block:: python
343342
344343
from scipy.sparse import csr_matrix
345344
arr = np.random.random(size=(1000, 5))
@@ -351,7 +350,7 @@ All sparse formats are supported, but matrices that are not in :mod:`COOrdinate
351350
352351
To convert a ``SparseDataFrame`` back to sparse SciPy matrix in COO format, you can use:
353352

354-
.. ipython:: python
353+
.. code-block:: python
355354
356355
sdf.to_coo()
357356

0 commit comments

Comments
 (0)