Skip to content

Commit 9fca52c

Browse files
committed
Using existing type check functions
1 parent 5416711 commit 9fca52c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/core/algorithms.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
from pandas.core.dtypes.common import (
1717
is_array_like,
1818
is_unsigned_integer_dtype, is_signed_integer_dtype,
19-
is_integer_dtype, is_complex_dtype,
19+
is_integer, is_integer_dtype, is_complex_dtype,
2020
is_object_dtype,
2121
is_extension_array_dtype,
2222
is_categorical_dtype, is_sparse,
2323
is_period_dtype,
24-
is_numeric_dtype, is_float_dtype,
24+
is_numeric_dtype, is_float, is_float_dtype,
2525
is_bool_dtype, needs_i8_conversion,
2626
is_datetimetz, is_datetime_or_timedelta_dtype,
2727
is_datetime64_any_dtype, is_datetime64tz_dtype,
@@ -432,16 +432,13 @@ def isin(comps, values):
432432
comps_types = set(type(v) for v in comps)
433433
values_types = set(type(v) for v in values)
434434

435-
is_int = lambda x: ((x == np.int64) or (x == int))
436-
is_float = lambda x: ((x == np.float64) or (x == float))
437-
438435
int_flg = False
439436
float_flg = False
440437

441438
if len(comps_types) == len(values_types) == 1:
442439
comps_types = comps_types.pop()
443440
values_types = values_types.pop()
444-
int_flg = (is_int(comps_types) and is_int(values_types))
441+
int_flg = (is_integer(comps_types) and is_integer(values_types))
445442
float_flg = (is_float(comps_types) and is_float(values_types))
446443

447444
# GH16012

0 commit comments

Comments
 (0)