Is there anything I'm doing wrong? Please let me know.
A lot of people on the internet use the seaborn
package to do this. I accept using seaborn
is an easier method, but currently, I am learning specifically about matplotlib.pyplot
(I'm still a newbie to this), so I would need my code to be accordingly.
Thanks for understanding and for your help in advance!
CodePudding user response:
There are a lot of missing values in the Age
column of the Titanic data set. Either remove those rows, or fill the values with a default before creating a boxplot.
plt.boxplot(data['Age'].fillna(0.0))