text_html_output_1.png
import pandas as pd

df = pd.read_csv('/kaggle/input/students-performance-in-exams/StudentsPerformance.csv')

df.count()

avg_ms_all = df['math score'].mean()
avg_ms_men = df[df['gender'] == 'male']['math score'].mean()
avg_ms_female = df[df['gender'] == 'female']['math score'].mean()
print('avg_ms_all:', avg_ms_all)
print('avg_ms_men:', avg_ms_men)
print('avg_ms_female:', avg_ms_female)