Skip to content

Commit f73b1e3

Browse files
committed
fixed bug preventing non-string columns to be used. Requires pandas>=1.0.0
1 parent e66c918 commit f73b1e3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dabest/_classes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ def __init__(self, data, idx, x, y, paired, id_col, ci, resamples,
3737
# data_in_index_name = data_in.index.name
3838

3939

40-
40+
from collections import Hashable
4141
# Determine the kind of estimation plot we need to produce.
42-
if all([isinstance(i, str) for i in idx]):
42+
if all([isinstance(i, Hashable) for i in idx]):
4343
# flatten out idx.
44-
all_plot_groups = pd.unique([t for t in idx]).tolist()
44+
all_plot_groups = set(idx)
4545
if len(idx) > len(all_plot_groups):
4646
err0 = '`idx` contains duplicated groups. Please remove any duplicates and try again.'
4747
raise ValueError(err0)

0 commit comments

Comments
 (0)