Skip to content

Commit deac0ab

Browse files
further clean-up
1 parent b4e0cdc commit deac0ab

File tree

1 file changed

+37
-50
lines changed

1 file changed

+37
-50
lines changed

doc/source/whatsnew/v0.19.0.txt

+37-50
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ Furthermore:
847847
""""""""""""""""""""""""""""""""""""""""
848848

849849
``PeriodIndex`` now has its own ``period`` dtype. The ``period`` dtype is a
850-
pandas extension dtype like ``category`` or :ref:`timezone aware dtype <timeseries.timezone_series>` (``datetime64[ns, tz]``). (:issue:`13941`).
850+
pandas extension dtype like ``category`` or the :ref:`timezone aware dtype <timeseries.timezone_series>` (``datetime64[ns, tz]``). (:issue:`13941`).
851851
As a consequence of this change, ``PeriodIndex`` no longer has an integer dtype:
852852

853853
Previous Behavior:
@@ -900,7 +900,7 @@ These result in ``pd.NaT`` without providing ``freq`` option.
900900
pd.Period(None)
901901

902902

903-
To be compat with ``Period`` addition and subtraction, ``pd.NaT`` now supports addition and subtraction with ``int``. Previously it raises ``ValueError``.
903+
To be compatible with ``Period`` addition and subtraction, ``pd.NaT`` now supports addition and subtraction with ``int``. Previously it raised ``ValueError``.
904904

905905
Previous Behavior:
906906

@@ -920,8 +920,8 @@ New Behavior:
920920
``PeriodIndex.values`` now returns array of ``Period`` object
921921
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
922922

923-
``.values`` is changed to return array of ``Period`` object, rather than array
924-
of ``int64`` (:issue:`13988`)
923+
``.values`` is changed to return an array of ``Period`` objects, rather than an array
924+
of integers (:issue:`13988`).
925925

926926
Previous Behavior:
927927

@@ -961,7 +961,7 @@ Previous behavior:
961961
FutureWarning: using '+' to provide set union with Indexes is deprecated, use '|' or .union()
962962
Out[1]: Index(['a', 'b', 'c'], dtype='object')
963963

964-
The same operation will now perform element-wise addition:
964+
New Behavior: the same operation will now perform element-wise addition:
965965

966966
.. ipython:: python
967967

@@ -1029,8 +1029,7 @@ New Behavior:
10291029
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10301030

10311031
``Index.unique()`` now returns unique values as an
1032-
``Index`` of the appropriate ``dtype``. (:issue:`13395`)
1033-
1032+
``Index`` of the appropriate ``dtype``. (:issue:`13395`).
10341033
Previously, most ``Index`` classes returned ``np.ndarray``, and ``DatetimeIndex``,
10351034
``TimedeltaIndex`` and ``PeriodIndex`` returned ``Index`` to keep metadata like timezone.
10361035

@@ -1042,9 +1041,10 @@ Previous Behavior:
10421041
Out[1]: array([1, 2, 3])
10431042

10441043
In [2]: pd.DatetimeIndex(['2011-01-01', '2011-01-02', '2011-01-03'], tz='Asia/Tokyo').unique()
1045-
Out[2]: DatetimeIndex(['2011-01-01 00:00:00+09:00', '2011-01-02 00:00:00+09:00',
1046-
'2011-01-03 00:00:00+09:00'],
1047-
dtype='datetime64[ns, Asia/Tokyo]', freq=None)
1044+
Out[2]:
1045+
DatetimeIndex(['2011-01-01 00:00:00+09:00', '2011-01-02 00:00:00+09:00',
1046+
'2011-01-03 00:00:00+09:00'],
1047+
dtype='datetime64[ns, Asia/Tokyo]', freq=None)
10481048

10491049
New Behavior:
10501050

@@ -1055,8 +1055,8 @@ New Behavior:
10551055

10561056
.. _whatsnew_0190.api.multiindex:
10571057

1058-
``MultiIndex`` constructors preserve categorical dtypes
1059-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1058+
``MultiIndex`` constructors, ``groupby`` and ``set_index`` preserve categorical dtypes
1059+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10601060

10611061
``MultiIndex.from_arrays`` and ``MultiIndex.from_product`` will now preserve categorical dtype
10621062
in ``MultiIndex`` levels. (:issue:`13743`, :issue:`13854`)
@@ -1078,7 +1078,7 @@ Previous Behavior:
10781078
In [5]: midx.get_level_values[0]
10791079
Out[5]: Index(['a', 'b'], dtype='object')
10801080

1081-
New Behavior:
1081+
New Behavior: the single level is now a ``CategoricalIndex``:
10821082

10831083
.. ipython:: python
10841084

@@ -1131,8 +1131,8 @@ New Behavior:
11311131
``read_csv`` will progressively enumerate chunks
11321132
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11331133

1134-
When :func:`read_csv` is called with ``chunksize='n'`` and without specifying an index,
1135-
each chunk used to have an independently generated index from `0`` to ``n-1``.
1134+
When :func:`read_csv` is called with ``chunksize=n`` and without specifying an index,
1135+
each chunk used to have an independently generated index from ``0`` to ``n-1``.
11361136
They are now given instead a progressive index, starting from ``0`` for the first chunk,
11371137
from ``n`` for the second, and so on, so that, when concatenated, they are identical to
11381138
the result of calling :func:`read_csv` without the ``chunksize=`` argument.
@@ -1167,13 +1167,12 @@ Sparse Changes
11671167

11681168
These changes allow pandas to handle sparse data with more dtypes, and for work to make a smoother experience with data handling.
11691169

1170-
11711170
``int64`` and ``bool`` support enhancements
11721171
"""""""""""""""""""""""""""""""""""""""""""
11731172

1174-
Sparse data structures now gained enhanced support of ``int64`` and ``bool`` ``dtype`` (:issue:`667`, :issue:`13849`)
1173+
Sparse data structures now gained enhanced support of ``int64`` and ``bool`` ``dtype`` (:issue:`667`, :issue:`13849`).
11751174

1176-
Previously, sparse data were ``float64`` dtype by default, even if all inputs were ``int`` or ``bool`` dtype. You had to specify ``dtype`` explicitly to create sparse data with ``int64`` dtype. Also, ``fill_value`` had to be specified explicitly becuase it's default was ``np.nan`` which doesn't appear in ``int64`` or ``bool`` data.
1175+
Previously, sparse data were ``float64`` dtype by default, even if all inputs were of ``int`` or ``bool`` dtype. You had to specify ``dtype`` explicitly to create sparse data with ``int64`` dtype. Also, ``fill_value`` had to be specified explicitly because the default was ``np.nan`` which doesn't appear in ``int64`` or ``bool`` data.
11771176

11781177
.. code-block:: ipython
11791178

@@ -1200,9 +1199,9 @@ Previously, sparse data were ``float64`` dtype by default, even if all inputs we
12001199
IntIndex
12011200
Indices: array([0, 1], dtype=int32)
12021201

1203-
As of v0.19.0, sparse data keeps the input dtype, and assign more appropriate ``fill_value`` default (``0`` for ``int64`` dtype, ``False`` for ``bool`` dtype).
1202+
As of v0.19.0, sparse data keeps the input dtype, and uses more appropriate ``fill_value`` defaults (``0`` for ``int64`` dtype, ``False`` for ``bool`` dtype).
12041203

1205-
.. ipython :: python
1204+
.. ipython:: python
12061205

12071206
pd.SparseArray([1, 2, 0, 0], dtype=np.int64)
12081207
pd.SparseArray([True, False, False, False])
@@ -1214,29 +1213,29 @@ Operators now preserve dtypes
12141213

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

1217-
.. ipython:: python
1216+
.. ipython:: python
12181217

1219-
s = pd.SparseSeries([0, 2, 0, 1], fill_value=0, dtype=np.int64)
1220-
s.dtype
1218+
s = pd.SparseSeries([0, 2, 0, 1], fill_value=0, dtype=np.int64)
1219+
s.dtype
12211220

1222-
s + 1
1221+
s + 1
12231222

12241223
- Sparse data structure now support ``astype`` to convert internal ``dtype`` (:issue:`13900`)
12251224

1226-
.. ipython:: python
1225+
.. ipython:: python
12271226

1228-
s = pd.SparseSeries([1., 0., 2., 0.], fill_value=0)
1229-
s
1230-
s.astype(np.int64)
1227+
s = pd.SparseSeries([1., 0., 2., 0.], fill_value=0)
1228+
s
1229+
s.astype(np.int64)
12311230

1232-
``astype`` fails if data contains values which cannot be converted to specified ``dtype``.
1233-
Note that the limitation is applied to ``fill_value`` which default is ``np.nan``.
1231+
``astype`` fails if data contains values which cannot be converted to specified ``dtype``.
1232+
Note that the limitation is applied to ``fill_value`` which default is ``np.nan``.
12341233

1235-
.. code-block:: ipython
1234+
.. code-block:: ipython
12361235

1237-
In [7]: pd.SparseSeries([1., np.nan, 2., np.nan], fill_value=np.nan).astype(np.int64)
1238-
Out[7]:
1239-
ValueError: unable to coerce current fill_value nan to int64 dtype
1236+
In [7]: pd.SparseSeries([1., np.nan, 2., np.nan], fill_value=np.nan).astype(np.int64)
1237+
Out[7]:
1238+
ValueError: unable to coerce current fill_value nan to int64 dtype
12401239

12411240
Other sparse fixes
12421241
""""""""""""""""""
@@ -1358,6 +1357,7 @@ Deprecations
13581357

13591358
Removal of prior version deprecations/changes
13601359
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1360+
13611361
- The ``SparsePanel`` class has been removed (:issue:`13778`)
13621362
- The ``pd.sandbox`` module has been removed in favor of the external library ``pandas-qt`` (:issue:`13670`)
13631363
- The ``pandas.io.data`` and ``pandas.io.wb`` modules are removed in favor of
@@ -1371,35 +1371,23 @@ Removal of prior version deprecations/changes
13711371
- ``DataFrame.to_sql()`` has dropped the ``mysql`` option for the ``flavor`` parameter (:issue:`13611`)
13721372
- ``Panel.shift()`` has dropped the ``lags`` parameter in favour of ``periods`` (:issue:`14041`)
13731373
- ``pd.Index`` has dropped the ``diff`` method in favour of ``difference`` (:issue:`13669`)
1374-
13751374
- ``pd.DataFrame`` has dropped the ``to_wide`` method in favour of ``to_panel`` (:issue:`14039`)
13761375
- ``Series.to_csv`` has dropped the ``nanRep`` parameter in favor of ``na_rep`` (:issue:`13804`)
13771376
- ``Series.xs``, ``DataFrame.xs``, ``Panel.xs``, ``Panel.major_xs``, and ``Panel.minor_xs`` have dropped the ``copy`` parameter (:issue:`13781`)
13781377
- ``str.split`` has dropped the ``return_type`` parameter in favor of ``expand`` (:issue:`13701`)
1379-
- Removal of the legacy time rules (offset aliases), deprecated since 0.17.0 (this has been alias since 0.8.0) (:issue:`13590`, :issue:`13868`)
1380-
1381-
Previous Behavior:
1382-
1383-
.. code-block:: ipython
1384-
1385-
In [2]: pd.date_range('2016-07-01', freq='W@MON', periods=3)
1386-
pandas/tseries/frequencies.py:465: FutureWarning: Freq "W@MON" is deprecated, use "W-MON" as alternative.
1387-
Out[2]: DatetimeIndex(['2016-07-04', '2016-07-11', '2016-07-18'], dtype='datetime64[ns]', freq='W-MON')
1388-
1389-
Now legacy time rules raises ``ValueError``. For the list of currently supported offsets, see :ref:`here <timeseries.offset_aliases>`
1390-
1378+
- Removal of the legacy time rules (offset aliases), deprecated since 0.17.0 (this has been alias since 0.8.0) (:issue:`13590`, :issue:`13868`). Now legacy time rules raises ``ValueError``. For the list of currently supported offsets, see :ref:`here <timeseries.offset_aliases>`.
13911379
- The default value for the ``return_type`` parameter for ``DataFrame.plot.box`` and ``DataFrame.boxplot`` changed from ``None`` to ``"axes"``. These methods will now return a matplotlib axes by default instead of a dictionary of artists. See :ref:`here <visualization.box.return>` (:issue:`6581`).
13921380
- The ``tquery`` and ``uquery`` functions in the ``pandas.io.sql`` module are removed (:issue:`5950`).
13931381

1382+
13941383
.. _whatsnew_0190.performance:
13951384

13961385
Performance Improvements
13971386
~~~~~~~~~~~~~~~~~~~~~~~~
13981387

13991388
- Improved performance of sparse ``IntIndex.intersect`` (:issue:`13082`)
14001389
- Improved performance of sparse arithmetic with ``BlockIndex`` when the number of blocks are large, though recommended to use ``IntIndex`` in such cases (:issue:`13082`)
1401-
- increased performance of ``DataFrame.quantile()`` as it now operates per-block (:issue:`11623`)
1402-
1390+
- Improved performance of ``DataFrame.quantile()`` as it now operates per-block (:issue:`11623`)
14031391
- Improved performance of float64 hash table operations, fixing some very slow indexing and groupby operations in python 3 (:issue:`13166`, :issue:`13334`)
14041392
- Improved performance of ``DataFrameGroupBy.transform`` (:issue:`12737`)
14051393
- Improved performance of ``Index`` and ``Series`` ``.duplicated`` (:issue:`10235`)
@@ -1410,7 +1398,6 @@ Performance Improvements
14101398
- Improved performance of ``factorize`` of datetime with timezone (:issue:`13750`)
14111399

14121400

1413-
14141401
.. _whatsnew_0190.bug_fixes:
14151402

14161403
Bug Fixes

0 commit comments

Comments
 (0)