import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from pyodide.http import open_url
data=pd.read_csv(open_url("https://raw.githubusercontent.com/knavee12345/knavee12345/main/Certifications/depressed.csv"))
data=data.fillna(0)
depressed_data=data.query("(mental_health=='Depressed')")
Mental Health
Age
Children
Education Level
Family Members
Relationship Status
Gender
plt.style.use("dark_background")
plt.rcParams.update({'text.color':"white",'axes.labelcolor':"white",'font.size':15})
fig,ax=plt.subplots()
data.mental_health.value_counts().plot(kind="pie",explode=(0,.3),autopct='%1.f%%',colors=["blue","red"],legend=True,shadow=True)
plt.title("Mental Health")
ax.legend(loc=(0.8,0.8),prop={"size":13})
plt.ylabel(None)
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig
fig,ax=plt.subplots()
depressed_data.age.plot(kind="hist",color="r")
plt.title("Age")
plt.ylabel("Count")
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig
fig,ax=plt.subplots()
sns.countplot(x="number_children",data=depressed_data)
plt.title("Children")
plt.ylabel("People Count")
plt.xlabel("Children Count")
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig
fig,ax=plt.subplots()
depressed_data.education_level.plot(kind="hist",color="r")
plt.title("Education Level")
plt.ylabel("Count")
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig
fig,ax=plt.subplots()
depressed_data.total_members.plot(kind="hist",color="r")
plt.title("Familly Members")
plt.ylabel("Count")
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig
fig,ax=plt.subplots()
depressed_data.relationship.value_counts().plot(kind="pie",colors=["r","b"],autopct="%1.f%%",shadow=True)
plt.title("Relationship Status")
ax.legend(loc=(0.9,0.8))
plt.ylabel(None)
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig
fig,ax=plt.subplots()
depressed_data.sex.value_counts().plot(kind="pie",autopct="%1.f%%",colors=["blue","red"],labels=["Female","Male"],shadow=True)
plt.title("Gender")
ax.legend(loc=(0.9,0.8))
plt.ylabel(None)
fig.patch.set_alpha(0)
ax.patch.set_alpha(0)
fig