diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 3df82b6c13259..a745ec616eda8 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -216,10 +216,7 @@ def _get_data_algo(values, func_map): # its cheaper to use a String Hash Table than Object if lib.infer_dtype(values) in ['string']: - try: - f = func_map['string'] - except KeyError: - pass + ndtype = 'string' f = func_map.get(ndtype, func_map['object'])