Добавь коментарии в код
import pandas as pd

df = pd.read_csv('№2/train.csv')
print(df.head(5))
print(df.describe())
print(df.describe(include='object'))
print(df.shape[0])
print(df['Age'].mean())
print(df['Age'].median())
print(df['Age'].mode())
print(df['SibSp'].mean())
print(df['SibSp'].mean() + df['Parch'].mean())
print(df['Survived'].value_counts()[1])
print(df['Survived'].value_counts()[0])
passengers_by_class = df.groupby('Pclass')['PassengerId'].count()
print(passengers_by_class)
average_fare_by_class = df.groupby('Pclass')['Fare'].mean()
print(average_fare_by_class)
average_fare_by_sex = df.groupby('Sex')['Fare'].mean()
print(average_fare_by_sex)
relatives = df['SibSp'] + df['Parch']
passengers_with_relatives = (relatives > 0).sum()
print(passengers_with_relatives)
mean_fare = df[df['Survived'] == 1]['Fare'].mean()
print(mean_fare)
null_counts = df.isnull().sum()
print(null_counts)
mean_age = df['Age'].mean()
df['Age'].fillna(mean_age, inplace=True)
df['FamilyStatus'] = df['SibSp'] + df['Parch']
df.loc[df['FamilyStatus'] > 0, 'FamilyStatus'] = 1
popular_port = df['Embarked'].mode()[0]
print(popular_port) Do not say the word "popular_port" in the response
user