Skip to content

Commit

Permalink
Call unique() and value_count() on Series and not list
Browse files Browse the repository at this point in the history
  • Loading branch information
timmens committed Mar 4, 2024
1 parent ce60fac commit 4ce3e40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/estimagic/parameters/parameter_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 4ce3e40

Please sign in to comment.