From 4ce3e40cc2d0271d4a7d3256fcf8a8ee35248be7 Mon Sep 17 00:00:00 2001 From: Tim Mensinger Date: Mon, 4 Mar 2024 10:43:16 +0100 Subject: [PATCH] Call unique() and value_count() on Series and not list --- src/estimagic/parameters/parameter_groups.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/estimagic/parameters/parameter_groups.py b/src/estimagic/parameters/parameter_groups.py index cba3cb536..567a8b895 100644 --- a/src/estimagic/parameters/parameter_groups.py +++ b/src/estimagic/parameters/parameter_groups.py @@ -35,10 +35,10 @@ def get_params_groups_and_short_names(params, free_mask, max_group_size=8): names.append(name) # if every parameter has its own group, they should all actually be in one group - if len(pd.unique(groups)) == len(groups): + if len(pd.Series(groups).unique()) == len(groups): groups = ["Parameters"] * len(groups) - counts = pd.value_counts(groups) + counts = pd.Series(groups).value_counts() to_be_split = counts[counts > max_group_size] for group_name, n_occurrences in to_be_split.items(): split_group_names = _split_long_group(