Skip to content

Commit 246cab5

Browse files
committed
use .any() instead of any() + whatsnew entry
1 parent 656b6b4 commit 246cab5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/whatsnew/v1.1.3.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Bug fixes
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`)
3232
- Bug in :meth:`DataFrame.stack` raising a ``ValueError`` when stacking :class:`MultiIndex` columns based on position when the levels had duplicate names (:issue:`36353`)
33+
- Bug in :meth:`isin()` when using NaN and a row length above 1,000,000 (:issue:`22205`)
3334

3435
.. ---------------------------------------------------------------------------
3536

pandas/core/algorithms.py

Lines changed: 1 addition & 1 deletion
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)