Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boxplots with multiple categories with seaborn

This should be really easy but I can't figure it out for the life of me. Here is a sample of my dataframe.

enter image description here \n

sns.boxplot(x='dataset', y='value', hue='Model', data=dd)

but I get this error

ValueError: List of boxplot statistics andpositionsvalues must have same the length

like image 606
Marc On Avatar asked Jan 04 '18 18:01

Marc On


1 Answers

As was mentioned in the comments you want to convert your data to floats

dd['value'] = dd['value'].astype(float)
sns.boxplot(x='dataset', y='value', hue='Model', data=dd)

Should work for you

like image 192
johnchase Avatar answered Nov 12 '22 17:11

johnchase