Skip to content

Commit 3c030cd

Browse files
committed
use .any() instead of any() + whatsnew entry
1 parent dbbf613 commit 3c030cd

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/whatsnew/v1.1.3.rst

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Bug fixes
2929
- Bug in :func:`read_spss` where passing a ``pathlib.Path`` as ``path`` would raise a ``TypeError`` (:issue:`33666`)
3030
- Bug in :meth:`Series.str.startswith` and :meth:`Series.str.endswith` with ``category`` dtype not propagating ``na`` parameter (:issue:`36241`)
3131
- Bug in :class:`Series` constructor where integer overflow would occur for sufficiently large scalar inputs when an index was provided (:issue:`36291`)
32+
- Bug in :meth:`isin()` when using NaN and a row length above 1,000,000 (:issue:`22205`)
3233

3334
.. ---------------------------------------------------------------------------
3435

pandas/core/algorithms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def isin(comps: AnyArrayLike, values: AnyArrayLike) -> np.ndarray:
442442
if len(comps) > 1_000_000 and not is_object_dtype(comps):
443443
# If the the values include nan we need to check for nan explicitly
444444
# since np.nan it not equal to np.nan
445-
if any(np.isnan(values)):
445+
if np.isnan(values).any():
446446
f = lambda c, v: np.logical_or(np.in1d(c, v), np.isnan(c))
447447
else:
448448
f = np.in1d

0 commit comments

Comments
 (0)