Skip to content

Commit 303e6ac

Browse files
committed
add comment
1 parent ef49ca3 commit 303e6ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/algorithms.py

+4
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ def isin(comps: AnyArrayLike, values: AnyArrayLike) -> np.ndarray:
435435

436436
f = htable.ismember_object
437437

438+
# an alternative is to use np.in1d if values has a few
439+
# elements (about 10) - it is faster than a hash-table
440+
# for these cases. However, one must be cautious with
441+
# nans (see GH22205)
438442
if is_integer_dtype(comps.dtype):
439443
try:
440444
values = values.astype("int64", copy=False)

0 commit comments

Comments
 (0)