Issue
I tired to make a boxplot which shows 'age' boxplot of 'unsurvived' male and female data. There're some of empty data in raw. But some of them still have their own data. But it panadas shows 'min() arg is an empty sequence' How can I fix this problem?
sns.boxplot(x="Sex", y="Age", data=df[df["Survived"]]==0])
Solution
You are performing the filtering incorrectly. This should be:
sns.boxplot(x="Sex", y="Age", data=df[df["Survived"]==0])
If the error persists, ensure you have at least one row of data. You can check the output of:
df[df["Survived"]==0]
If you don't have any rows, check the output of:
df["Survived"].unique()
And ensure 0
is present with the same type (eg. not '0'
as string).
Answered By - mozway
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.