Skip to content

Commit e6a00aa

Browse files
committed
Using isnaobj instead of list comprehension (pandas-dev#35498)
1 parent 494f507 commit e6a00aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/_libs/index.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from pandas._libs.tslibs.timedeltas cimport _Timedelta
2929
from pandas._libs.hashtable cimport HashTable
3030

3131
from pandas._libs import algos, hashtable as _hash
32-
from pandas._libs.missing import checknull
32+
from pandas._libs.missing import checknull, isnaobj
3333

3434

3535
cdef inline bint is_definitely_invalid_key(object val):
@@ -270,7 +270,7 @@ cdef class IndexEngine:
270270
Py_ssize_t i, j, n, n_t, n_alloc
271271

272272
self._ensure_mapping_populated()
273-
if any([checknull(t) for t in targets]):
273+
if isnaobj(targets).any():
274274
new_targets = [0 if checknull(t) else t for t in targets]
275275
new_values = [0 if checknull(v) else v for v in self._get_index_values()]
276276
targets = np.array(new_targets, dtype=object)

0 commit comments

Comments
 (0)