Skip to content

Commit b061055

Browse files
committed
DOC: corrections for None/np.nan comparisons
1 parent 2da060c commit b061055

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/source/missing_data.rst

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pandas provides the :func:`~pandas.core.common.isnull` and
9191
.. warning::
9292

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

9596
.. ipython:: python
9697

doc/source/whatsnew/v0.17.0.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Boolean comparisons of a ``Series`` vs ``None`` will now be equivalent to compar
230230

231231
.. ipython:: python
232232

233-
s = Series(range(3.))
233+
s = Series(range(3))
234234
s.iloc[1] = None
235235
s
236236

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

258258
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
259-
mindful that ``nan's`` don't compare equal, but ``None's`` do.
259+
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``.
260260

261261
.. ipython:: python
262262

0 commit comments

Comments
 (0)