Skip to content

Commit

Permalink
Using isnaobj instead of list comprehension (pandas-dev#35498)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexhlim committed Aug 4, 2020
1 parent 494f507 commit e6a00aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ from pandas._libs.tslibs.timedeltas cimport _Timedelta
from pandas._libs.hashtable cimport HashTable

from pandas._libs import algos, hashtable as _hash
from pandas._libs.missing import checknull
from pandas._libs.missing import checknull, isnaobj


cdef inline bint is_definitely_invalid_key(object val):
Expand Down Expand Up @@ -270,7 +270,7 @@ cdef class IndexEngine:
Py_ssize_t i, j, n, n_t, n_alloc

self._ensure_mapping_populated()
if any([checknull(t) for t in targets]):
if isnaobj(targets).any():
new_targets = [0 if checknull(t) else t for t in targets]
new_values = [0 if checknull(v) else v for v in self._get_index_values()]
targets = np.array(new_targets, dtype=object)
Expand Down

0 comments on commit e6a00aa

Please sign in to comment.