Skip to content

Commit b1a1613

Browse files
committed
DOC: whatsnew updates
1 parent e26b3b9 commit b1a1613

File tree

1 file changed

+80
-69
lines changed

1 file changed

+80
-69
lines changed

doc/source/whatsnew/v0.17.0.txt

+80-69
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ users upgrade to this version.
1414
Highlights include:
1515

1616
- Release the Global Interpreter Lock (GIL) on some cython operations, see :ref:`here <whatsnew_0170.gil>`
17+
- The default for ``to_datetime`` will now be to ``raise`` when presented with unparseable formats,
18+
previously this would return the original input, see :ref:`here <whatsnew_0170.api_breaking.to_datetime>`
19+
- The default for ``dropna`` in ``HDFStore`` has changed to ``False``, to store by default all rows even
20+
if they are all ``NaN``, see :ref:`here <whatsnew_0170.api_breaking.hdf_dropna>`
1721
- Development installed versions of pandas will now have ``PEP440`` compliant version strings (:issue:`9518`)
1822

1923
Check the :ref:`API Changes <whatsnew_0170.api>` and :ref:`deprecations <whatsnew_0170.deprecations>` before updating.
@@ -51,9 +55,10 @@ as well as the ``.sum()`` operation.
5155
'data' : np.random.randn(N) })
5256
df.groupby('key')['data'].sum()
5357

54-
Releasing of the GIL could benefit an application that uses threads for user interactions (e.g. ``QT``), or performaning multi-threaded computations. A nice example of a library that can handle these types of computation-in-parallel is the dask_ library.
58+
Releasing of the GIL could benefit an application that uses threads for user interactions (e.g. QT_), or performaning multi-threaded computations. A nice example of a library that can handle these types of computation-in-parallel is the dask_ library.
5559

5660
.. _dask: https://dask.readthedocs.org/en/latest/
61+
.. _QT: https://wiki.python.org/moin/PyQt
5762

5863
.. _whatsnew_0170.enhancements.other:
5964

@@ -133,32 +138,35 @@ input as in previous versions. (:issue:`10636`)
133138

134139
Previous Behavior:
135140

136-
.. code-block:: python
141+
.. code-block:: python
137142

138-
In [2]: pd.to_datetime(['2009-07-31', 'asd'])
139-
Out[2]: array(['2009-07-31', 'asd'], dtype=object)
143+
In [2]: pd.to_datetime(['2009-07-31', 'asd'])
144+
Out[2]: array(['2009-07-31', 'asd'], dtype=object)
140145

141146
New Behavior:
142147

143-
.. ipython:: python
144-
:okexcept:
148+
.. code-block:: python
145149

146-
pd.to_datetime(['2009-07-31', 'asd'])
150+
In [3]: pd.to_datetime(['2009-07-31', 'asd'])
151+
ValueError: Unknown string format
147152

148-
Of course you can coerce this as well.
153+
.. ipython:: python
149154

150-
.. ipython:: python
155+
pd.to_datetime(['2009-07-31', 'asd'])
151156

152-
to_datetime(['2009-07-31', 'asd'], errors='coerce')
157+
Of course you can coerce this as well.
153158

154-
To keep the previous behaviour, you can use `errors='ignore'`:
159+
.. ipython:: python
155160

156-
.. ipython:: python
157-
:okexcept:
161+
to_datetime(['2009-07-31', 'asd'], errors='coerce')
158162

159-
to_datetime(['2009-07-31', 'asd'], errors='ignore')
163+
To keep the previous behaviour, you can use `errors='ignore'`:
160164

161-
``pd.to_timedelta`` gained a similar API, of ``errors='raise'|'ignore'|'coerce'``, and the ``coerce`` keyword
165+
.. ipython:: python
166+
167+
to_datetime(['2009-07-31', 'asd'], errors='ignore')
168+
169+
Furthermore, ``pd.to_timedelta`` has gained a similar API, of ``errors='raise'|'ignore'|'coerce'``. The ``coerce`` keyword
162170
has been deprecated in favor of ``errors='coerce'``.
163171

164172
.. _whatsnew_0170.api_breaking.convert_objects:
@@ -337,71 +345,37 @@ Usually you simply want to know which values are null.
337345
None == None
338346
np.nan == np.nan
339347

348+
.. _whatsnew_0170.api_breaking.hdf_dropna:
340349

341-
.. _whatsnew_0170.api_breaking.other:
342-
343-
Other API Changes
344-
^^^^^^^^^^^^^^^^^
345-
346-
- Enable writing Excel files in :ref:`memory <_io.excel_writing_buffer>` using StringIO/BytesIO (:issue:`7074`)
347-
- Enable serialization of lists and dicts to strings in ExcelWriter (:issue:`8188`)
348-
- Allow passing `kwargs` to the interpolation methods (:issue:`10378`).
349-
- Serialize metadata properties of subclasses of pandas objects (:issue:`10553`).
350-
- ``Categorical.name`` was removed to make `Categorical` more ``numpy.ndarray`` like. Use ``Series(cat, name="whatever")`` instead (:issue:`10482`).
351-
- ``Categorical.unique`` now returns new ``Categorical`` which ``categories`` and ``codes`` are unique, rather than returnning ``np.array`` (:issue:`10508`)
352-
353-
- unordered category: values and categories are sorted by appearance order.
354-
- ordered category: values are sorted by appearance order, categories keeps existing order.
355-
356-
.. ipython :: python
357-
358-
cat = pd.Categorical(['C', 'A', 'B', 'C'], categories=['A', 'B', 'C'], ordered=True)
359-
cat
360-
cat.unique()
361-
362-
cat = pd.Categorical(['C', 'A', 'B', 'C'], categories=['A', 'B', 'C'])
363-
cat
364-
cat.unique()
365-
366-
- ``groupby`` using ``Categorical`` follows the same rule as ``Categorical.unique`` described above (:issue:`10508`)
367-
- ``NaT``'s methods now either raise ``ValueError``, or return ``np.nan`` or ``NaT`` (:issue:`9513`)
368-
369-
=============================== ==============================================================
370-
Behavior Methods
371-
=============================== ==============================================================
372-
``return np.nan`` ``weekday``, ``isoweekday``
373-
``return NaT`` ``date``, ``now``, ``replace``, ``to_datetime``, ``today``
374-
``return np.datetime64('NaT')`` ``to_datetime64`` (unchanged)
375-
``raise ValueError`` All other public methods (names not beginning with underscores)
376-
=============================== ===============================================================
350+
HDFStore dropna behavior
351+
^^^^^^^^^^^^^^^^^^^^^^^^
377352

353+
default behavior for HDFStore write functions with ``format='table'`` is now to keep rows that are all missing except for index. Previously, the behavior was to drop rows that were all missing save the index. The previous behavior can be replicated using the ``dropna=True`` option. (:issue:`9382`)
378354

379-
- default behavior for HDFStore write functions with ``format='table'`` is now to keep rows that are all missing except for index. Previously, the behavior was to drop rows that were all missing save the index. The previous behavior can be replicated using the ``dropna=True`` option. (:issue:`9382`)
380-
381-
Previously,
355+
Previously:
382356

383357
.. ipython:: python
384358

385-
df_with_missing = pd.DataFrame({'col1':[0, np.nan, 2],
359+
df_with_missing = pd.DataFrame({'col1':[0, np.nan, 2],
386360
'col2':[1, np.nan, np.nan]})
387-
361+
388362
df_with_missing
389363

390364

391365
.. code-block:: python
392366

393-
In [28]:
367+
In [28]:
394368
df_with_missing.to_hdf('file.h5', 'df_with_missing', format='table', mode='w')
395-
369+
396370
pd.read_hdf('file.h5', 'df_with_missing')
397-
398-
Out [28]:
371+
372+
Out [28]:
399373
col1 col2
400374
0 0 1
401375
2 2 NaN
402376

403377

404-
New behavior:
378+
New behavior:
405379

406380
.. ipython:: python
407381
:suppress:
@@ -411,15 +385,52 @@ New behavior:
411385
.. ipython:: python
412386

413387
df_with_missing.to_hdf('file.h5', 'df_with_missing', format = 'table', mode='w')
414-
388+
415389
pd.read_hdf('file.h5', 'df_with_missing')
416390

417391
.. ipython:: python
418392
:suppress:
419393

420394
os.remove('file.h5')
421395

422-
See :ref:`documentation <io.hdf5>` for more details.
396+
See :ref:`documentation <io.hdf5>` for more details.
397+
398+
.. _whatsnew_0170.api_breaking.other:
399+
400+
Other API Changes
401+
^^^^^^^^^^^^^^^^^
402+
403+
- Enable writing Excel files in :ref:`memory <_io.excel_writing_buffer>` using StringIO/BytesIO (:issue:`7074`)
404+
- Enable serialization of lists and dicts to strings in ExcelWriter (:issue:`8188`)
405+
- Allow passing `kwargs` to the interpolation methods (:issue:`10378`).
406+
- Serialize metadata properties of subclasses of pandas objects (:issue:`10553`).
407+
- ``Categorical.name`` was removed to make `Categorical` more ``numpy.ndarray`` like. Use ``Series(cat, name="whatever")`` instead (:issue:`10482`).
408+
- ``Categorical.unique`` now returns new ``Categorical`` which ``categories`` and ``codes`` are unique, rather than returning ``np.array`` (:issue:`10508`)
409+
410+
- unordered category: values and categories are sorted by appearance order.
411+
- ordered category: values are sorted by appearance order, categories keeps existing order.
412+
413+
.. ipython :: python
414+
415+
cat = pd.Categorical(['C', 'A', 'B', 'C'], categories=['A', 'B', 'C'], ordered=True)
416+
cat
417+
cat.unique()
418+
419+
cat = pd.Categorical(['C', 'A', 'B', 'C'], categories=['A', 'B', 'C'])
420+
cat
421+
cat.unique()
422+
423+
- ``groupby`` using ``Categorical`` follows the same rule as ``Categorical.unique`` described above (:issue:`10508`)
424+
- ``NaT``'s methods now either raise ``ValueError``, or return ``np.nan`` or ``NaT`` (:issue:`9513`)
425+
426+
=============================== ==============================================================
427+
Behavior Methods
428+
=============================== ==============================================================
429+
``return np.nan`` ``weekday``, ``isoweekday``
430+
``return NaT`` ``date``, ``now``, ``replace``, ``to_datetime``, ``today``
431+
``return np.datetime64('NaT')`` ``to_datetime64`` (unchanged)
432+
``raise ValueError`` All other public methods (names not beginning with underscores)
433+
=============================== ===============================================================
423434

424435
.. _whatsnew_0170.deprecations:
425436

@@ -490,13 +501,13 @@ Bug Fixes
490501

491502
- Bug that caused segfault when resampling an empty Series (:issue:`10228`)
492503
- Bug in ``DatetimeIndex`` and ``PeriodIndex.value_counts`` resets name from its result, but retains in result's ``Index``. (:issue:`10150`)
493-
- Bug in `pd.eval` using ``numexpr`` engine coerces 1 element numpy array to scalar (:issue:`10546`)
494-
- Bug in `pandas.concat` with ``axis=0`` when column is of dtype ``category`` (:issue:`10177`)
504+
- Bug in ``pd.eval`` using ``numexpr`` engine coerces 1 element numpy array to scalar (:issue:`10546`)
505+
- Bug in ``pd.concat`` with ``axis=0`` when column is of dtype ``category`` (:issue:`10177`)
495506
- Bug in ``read_msgpack`` where input type is not always checked (:issue:`10369`, :issue:`10630`)
496-
- Bug in `pandas.read_csv` with kwargs ``index_col=False``, ``index_col=['a', 'b']`` or ``dtype``
507+
- Bug in ``pd.read_csv`` with kwargs ``index_col=False``, ``index_col=['a', 'b']`` or ``dtype``
497508
(:issue:`10413`, :issue:`10467`, :issue:`10577`)
498-
- Bug in `Series.from_csv` with ``header`` kwarg not setting the ``Series.name`` or the ``Series.index.name`` (:issue:`10483`)
499-
- Bug in `groupby.var` which caused variance to be inaccurate for small float values (:issue:`10448`)
509+
- Bug in ``Series.from_csv`` with ``header`` kwarg not setting the ``Series.name`` or the ``Series.index.name`` (:issue:`10483`)
510+
- Bug in ``groupby.var`` which caused variance to be inaccurate for small float values (:issue:`10448`)
500511
- Bug in ``Series.plot(kind='hist')`` Y Label not informative (:issue:`10485`)
501512
- Bug in ``read_csv`` when using a converter which generates a ``uint8`` type (:issue:`9266`)
502513

@@ -510,7 +521,7 @@ Bug Fixes
510521

511522

512523
- Reading "famafrench" data via ``DataReader`` results in HTTP 404 error because of the website url is changed (:issue:`10591`).
513-
- Bug in `read_msgpack` where DataFrame to decode has duplicate column names (:issue:`9618`)
524+
- Bug in ``read_msgpack`` where DataFrame to decode has duplicate column names (:issue:`9618`)
514525
- Bug in ``io.common.get_filepath_or_buffer`` which caused reading of valid S3 files to fail if the bucket also contained keys for which the user does not have read permission (:issue:`10604`)
515526
- Bug in vectorised setting of timestamp columns with python ``datetime.date`` and numpy ``datetime64`` (:issue:`10408`, :issue:`10412`)
516527

0 commit comments

Comments
 (0)