Spaces:
Runtime error
Runtime error
Download EDA_Agent/code/code.py from Khaquan/Burhan02data-sci-chatbot: direct link, hf CLI and curl.
- Browser
- Download file 364 Bytes
-
https://huggingface.co/spaces/Khaquan/Burhan02data-sci-chatbot/resolve/main/EDA_Agent/code/code.py
- Command line
-
hf download hf://spaces/Khaquan/Burhan02data-sci-chatbot/EDA_Agent/code/code.py
-
curl -L -o code.py https://huggingface.co/spaces/Khaquan/Burhan02data-sci-chatbot/resolve/main/EDA_Agent/code/code.py
364 Bytes
| 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') |