From 8efb8f20b2601a5d1832949b67db895bd4f8a035 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 26 Nov 2023 21:33:41 +0100 Subject: [PATCH] Fixup --- pandas/core/algorithms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 1d93845f2f2ed..8e1b42f531b06 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 idx.dtype != keys.dtype: