Situation
I have the following pandas dataset:
|user_id|total|is_fat|
|-------|-----|------|
|1 |100 |1 |
|2 |150 |0 |
|3 |400 |1 |
|4 |500 |1 |
|5 |10 |0 |
where elements of the total are integer and elements of is_fat are string.
I denote above dataset by df
.
Then run the following code:
import seaborn as sos
sns.swarmplot(x = 'total', y ='is_fat', data = df)
Now the graph I expected looks like:
Problem However, the output graph is the following:
Why?
Search
If I convert '1' to 'fat' and '0' to 'not_fat',
then I get the expected graph.