Spaces:
Runtime error
Runtime error
File size: 364 Bytes
df420ed |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import matplotlib
matplotlib.use('Agg')
import os
os.chdir(f'{os.getcwd()}/EDA_Agent')
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('df.csv')
df.groupby('Sex')['Survived'].mean().plot(kind='bar', rot=0)
plt.ylabel('Survival Rate')
plt.xlabel('Gender')
plt.title('Survival Rate by Gender')
plt.savefig('graphs/survival_rate_by_gender.png') |