Skip to content

Commit 6fe6339

Browse files
committed
Revert "Use pivot_table instead of pd.pivot"
This reverts commit 8cdf24c.
1 parent 8cdf24c commit 6fe6339

3 files changed

Lines changed: 174 additions & 74 deletions

File tree

dabest/plotter.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,8 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
418418
pivot_values = [yvar]
419419
else:
420420
pivot_values = [yvar, color_col]
421-
# pivoted_plot_data = pd.pivot(data=plot_data, index=dabest_obj.id_col,
422-
# columns=xvar, values=pivot_values)
423-
pivoted_plot_data = plot_data.pivot_table(index=dabest_obj.id_col, columns=xvar, values=pivot_values)
421+
pivoted_plot_data = pd.pivot(data=plot_data, index=dabest_obj.id_col,
422+
columns=xvar, values=pivot_values)
424423
x_start = 0
425424
for ii, current_tuple in enumerate(temp_idx):
426425
current_pair = pivoted_plot_data.loc[:, pd.MultiIndex.from_product([pivot_values, current_tuple])].dropna()
@@ -437,11 +436,6 @@ def EffectSizeDataFramePlotter(EffectSizeDataFrame, **plot_kwargs):
437436
if isinstance(color_key, str) == True:
438437
slopegraph_kwargs['color'] = plot_palette_raw[color_key]
439438
slopegraph_kwargs['label'] = color_key
440-
else:
441-
color_key = str(color_key)
442-
slopegraph_kwargs['color'] = plot_palette_raw[color_key]
443-
slopegraph_kwargs['label'] = color_key
444-
445439

446440
rawdata_axes.plot(x_points, y_points, **slopegraph_kwargs)
447441
x_start = x_start + grp_count

0 commit comments

Comments
 (0)