File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 6
6
# pylint: disable=E1101,E1103
7
7
# pylint: disable=W0703,W0622,W0613,W0201
8
8
9
- import collections
10
9
import types
11
10
import warnings
12
11
@@ -2133,13 +2132,12 @@ def map_f(values, f):
2133
2132
else :
2134
2133
map_f = lib .map_infer
2135
2134
2136
- default_dict_types = collections .Counter , collections .defaultdict
2137
- if isinstance (arg , default_dict_types ):
2138
- dict_with_default = arg
2139
- arg = lambda x : dict_with_default [x ]
2140
-
2141
- elif isinstance (arg , dict ):
2142
- arg = self ._constructor (arg , index = arg .keys ())
2135
+ if isinstance (arg , dict ):
2136
+ if hasattr (arg , '__missing__' ):
2137
+ dict_with_default = arg
2138
+ arg = lambda x : dict_with_default [x ]
2139
+ else :
2140
+ arg = self ._constructor (arg , index = arg .keys ())
2143
2141
2144
2142
if isinstance (arg , Series ):
2145
2143
indexer = arg .index .get_indexer (values )
You can’t perform that action at this time.
0 commit comments