Skip to content

Commit

Permalink
fix bug when few different values (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel MASSOULARD authored and GitHub Enterprise committed May 27, 2020
1 parent 50a82c6 commit 9496bbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aikit/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def conditional_boxplot(df, var, explaining_var, nb_quantiles=10, use_rank=True,
var_bis = var
explaining_var_bis = explaining_var

df_copy["_quantile"] = pd.qcut(df_copy[explaining_var_bis], q=nb_quantiles)
df_copy["_quantile"] = pd.qcut(df_copy[explaining_var_bis], q=nb_quantiles, duplicates="drop")

positions = [np.median(sub_df[explaining_var_bis].values) for _, sub_df in df_copy.groupby("_quantile")]
if use_rank:
Expand Down

0 comments on commit 9496bbc

Please sign in to comment.