Skip to content

Commit

Permalink
moving whatsnew note to notable fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
realead committed Nov 9, 2021
1 parent e3fd597 commit 088b494
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion doc/source/whatsnew/v1.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,38 @@ Now the float-dtype is respected. Since the common dtype for these DataFrames is

*New behavior*:

.. ipython:: python
res
.. _whatsnew_140.notable_bug_fixes.value_counts_and_mode_do_not_coerse_to_nan:

Null-values are no longer coerced to NaN-value in value_counts and mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

:meth:`Series.value_counts` and :meth:`Series.mode` no longer coerce ``None``, ``NaT`` and other null-values to a NaN-value for ``np.object``-dtype. This behavior is now consistent with ``unique``, ``isin`` and others (:issue:`42688`).

.. ipython:: python
s = pd.Series([True, None, pd.NaT, None, pd.NaT, None])
res = s.value_counts(dropna=False)
Previously, all null-values were replaced by a NaN-value.

*Previous behavior*:

.. code-block:: ipython
In [3]: res
Out[3]:
NaN 5
True 1
dtype: int64
Now null-values are no longer mangled.

*New behavior*:

.. ipython:: python
res
Expand Down Expand Up @@ -549,7 +581,6 @@ Missing
^^^^^^^
- Bug in :meth:`DataFrame.fillna` with limit and no method ignores axis='columns' or ``axis = 1`` (:issue:`40989`)
- Bug in :meth:`DataFrame.fillna` not replacing missing values when using a dict-like ``value`` and duplicate column names (:issue:`43476`)
- :meth:`Series.value_counts` and :meth:`Series.mode` no longer coerce ``None``, ``NaT`` and other null-values to a NaN-value for ``np.object``-dtype. This behavior is now consistent with ``unique``, ``isin`` and others (:issue:`42688`)
-

MultiIndex
Expand Down

0 comments on commit 088b494

Please sign in to comment.