Seaborn: using boxplot runs out of memory

I would like to build three boxes for the values ​​1, 2 and 3 weight_cat(these are only the individual values ​​that it has). These boxes should show the height depending on the weight category ( weight_cat).

So, I have a data frame like this:

print data.head(5)

        Height    Weight  weight_cat
Index                                
1      65.78331  112.9925           1
2      71.51521  136.4873           2
3      69.39874  153.0269           3
4      68.21660  142.3354           2
5      67.78781  144.2971           2

The code below finally eats my whole ram. This is not normal, I believe:

Seaborn.boxplot(x="Height", y="weight_cat", data=data)

What is wrong here? This is a link to the manual . The shape of the data frame (25000.4). This is a link to a csv file .

Here's how you can get the same data:

data = pd.read_csv('weights_heights.csv', index_col='Index')
def weight_category(weight):
    newWeight = weight
    if newWeight < 120:
        return 1

    if newWeight >= 150:
        return 3

    else:
        return 2

data['weight_cat'] = data['Weight'].apply(weight_category)
+4
source share
1 answer

x y:

import seaborn as sns
sns.boxplot(x="weight_cat" y="Height", data=data)

, ( 24503).

:

enter image description here

, orient :

sns.boxplot(x='Height', y='weight_cat', data=data, orient='h')

, x y ( ).

+5

All Articles