diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index dc2eefc00e2b6..277c0f189df7a 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -931,7 +931,7 @@ def value_counts_internal( # For backwards compatibility, we let Index do its normal type # inference, _except_ for if if infers from object to bool. - idx = Index(keys, dtype=input_dtype) + idx = Index(keys, dtype=input_dtype if input_dtype != "float16" else None) if idx.dtype == bool and keys.dtype == object: idx = idx.astype(object) elif (