Exploratory Data Analysis in Python
Izzy Weber
Curriculum Manager, DataCamp
divorce["education_man"].value_counts()
Professional 1313
Preparatory 501
Secondary 288
Primary 100
None 4
Other 3
Name: education_man, dtype: int64
sns.histplot(data=divorce, x="marriage_duration", binwidth=1)
plt.show()
sns.histplot(data=divorce, x="marriage_duration", hue="education_man", binwidth=1)
plt.show()
sns.kdeplot(data=divorce, x="marriage_duration", hue="education_man")
plt.show()
sns.kdeplot(data=divorce, x="marriage_duration", hue="education_man", cut=0)
plt.show()
sns.kdeplot(data=divorce, x="marriage_duration", hue="education_man", cut=0, cumulative=True)
plt.show()
divorce["man_age_marriage"] = divorce["marriage_year"] - divorce["dob_man"].dt.year
divorce["woman_age_marriage"] = divorce["marriage_year"] - divorce["dob_woman"].dt.year
sns.scatterplot(data=divorce, x="woman_age_marriage", y="man_age_marriage")
plt.show()
sns.scatterplot(data=divorce,
x="woman_age_marriage",
y="man_age_marriage",
hue="education_man")
plt.show()
Exploratory Data Analysis in Python