Skip to content

Commit 0edcd94

Browse files
committed
fixed pep8
1 parent 563dc04 commit 0edcd94

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/core/indexes/multi.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# pylint: disable=E1101,E1103,W0232
33
import datetime
44
import warnings
5+
from functools import reduce
56
from sys import getsizeof
67

78
import numpy as np
@@ -2900,11 +2901,12 @@ def isin(self, values, level=None):
29002901
return np.lib.arraysetops.in1d(labs, sought_labels)
29012902

29022903
def searchsorted(self, arr):
2903-
from functools import reduce
2904-
dtype = reduce(lambda x, y : x + y, [l.dtype.descr for l in self.levels], [])
2905-
return self.values.astype(dtype).searchsorted(np.asarray(arr, dtype=dtype))
2904+
dtype = [l.dtype.descr for l in self.levels]
2905+
dtype = reduce(lambda x, y: x + y, dtype, [])
2906+
arr = np.asarray(arr, dtype=dtype)
2907+
values = self.values.astype(dtype)
2908+
return values.searchsorted(arr)
29062909

2907-
29082910

29092911
MultiIndex._add_numeric_methods_disabled()
29102912
MultiIndex._add_numeric_methods_add_sub_disabled()
@@ -2939,6 +2941,5 @@ def _sparsify(label_list, start=0, sentinel=''):
29392941
return lzip(*result)
29402942

29412943

2942-
29432944
def _get_na_rep(dtype):
29442945
return {np.datetime64: 'NaT', np.timedelta64: 'NaT'}.get(dtype, 'NaN')

0 commit comments

Comments
 (0)