Skip to content

Commit

Permalink
DOC: corrections for None/np.nan comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Jul 17, 2015
1 parent 2da060c commit b061055
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/source/missing_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pandas provides the :func:`~pandas.core.common.isnull` and
.. warning::

One has to be mindful that in python (and numpy), the ``nan's`` don't compare equal, but ``None's`` **do**.
Note that Pandas/numpy uses the fact that ``np.nan != np.nan``, and treats ``None`` like ``np.nan``.

.. ipython:: python
Expand Down
4 changes: 2 additions & 2 deletions doc/source/whatsnew/v0.17.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to compar

.. ipython:: python

s = Series(range(3.))
s = Series(range(3))
s.iloc[1] = None
s

Expand All @@ -256,7 +256,7 @@ Usually you simply want to know which values are null.
.. warning::

You generally will want to use ``isnull/notnull`` for these types of comparisons, as ``isnull/notnull`` tells you which elements are null. One has to be
mindful that ``nan's`` don't compare equal, but ``None's`` do.
mindful that ``nan's`` don't compare equal, but ``None's`` do. Note that Pandas/numpy uses the fact that ``np.nan != np.nan``, and treats ``None`` like ``np.nan``.

.. ipython:: python

Expand Down

0 comments on commit b061055

Please sign in to comment.