We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96d12a6 commit 97cfc49Copy full SHA for 97cfc49
pandas/core/series.py
@@ -2133,13 +2133,12 @@ def map_f(values, f):
2133
else:
2134
map_f = lib.map_infer
2135
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())
+ if isinstance(arg, dict):
+ if hasattr(arg, '__missing__'):
+ dict_with_default = arg
+ arg = lambda x: dict_with_default[x]
+ else:
+ arg = self._constructor(arg, index=arg.keys())
2143
2144
if isinstance(arg, Series):
2145
indexer = arg.index.get_indexer(values)
0 commit comments