Skip to content

Commit

Permalink
Listify conditional values so they can be sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
tomicapretto committed Oct 3, 2023
1 parent b074ba1 commit 8d7e161
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bambi/interpret/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def plot_comparisons(
raise ValueError("Must specify at least one of 'conditional' or 'average_by'.")

if isinstance(conditional, dict):
conditional = {key: sorted(value) for key, value in conditional.items()}
conditional = {key: sorted(listify(value)) for key, value in conditional.items()}
elif conditional is not None:
conditional = listify(conditional)
if len(conditional) > 3 and average_by is None:
Expand Down Expand Up @@ -474,7 +474,7 @@ def plot_slopes(
raise ValueError("Must specify at least one of 'conditional' or 'average_by'.")

if isinstance(conditional, dict):
conditional = {key: sorted(value) for key, value in conditional.items()}
conditional = {key: sorted(listify(value)) for key, value in conditional.items()}
elif conditional is not None:
conditional = listify(conditional)
if len(conditional) > 3 and average_by is None:
Expand Down

0 comments on commit 8d7e161

Please sign in to comment.