Skip to content

Commit 4a4d8c6

Browse files
committed
Merge branch 'propplot'
# Conflicts: # dabest/plotter.py
2 parents c34638f + c91d6c4 commit 4a4d8c6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

dabest/plotter.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,9 +484,7 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
484484
**swarmplot_kwargs)
485485
else:
486486
# Plot the raw data as a barplot.
487-
df_new = plot_data.copy()
488-
bar1_df = df_new.groupby(xvar).count().reset_index()
489-
bar1_df['proportion'] = [i / j for i, j in zip(bar1_df[yvar], bar1_df[yvar])]
487+
bar1_df = pd.DataFrame({xvar: all_plot_groups, 'proportion': np.ones(len(all_plot_groups))})
490488
bar1 = sns.barplot(data=bar1_df, x=xvar, y="proportion",
491489
ax=rawdata_axes,
492490
order=all_plot_groups,
@@ -780,9 +778,9 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
780778
# Check that the effect size is within the swarm ylims.
781779
if effect_size_type in ["mean_diff", "cohens_d", "hedges_g","cohens_h"]:
782780
control_group_summary = plot_data.groupby(xvar)\
783-
.mean().loc[current_control, yvar]
781+
.mean(numeric_only=True).loc[current_control, yvar]
784782
test_group_summary = plot_data.groupby(xvar)\
785-
.mean().loc[current_group, yvar]
783+
.mean(numeric_only=True).loc[current_group, yvar]
786784
elif effect_size_type == "median_diff":
787785
control_group_summary = plot_data.groupby(xvar)\
788786
.median().loc[current_control, yvar]

0 commit comments

Comments
 (0)