データの情報を表示

カラム、カラム数、行数など
print (train.info())

screenshot-www-kaggle-com-sublate-taitanic-1588578877098 (1)

 

上から5行を表示

train.head(3)

screenshot-www-kaggle-com-sublate-taitanic-1588576532435 (1)

‘Pclass’でグループ化しての‘Survived’の平均

train[['Pclass', 'Survived']].groupby(['Pclass'], as_index=False).mean()
# クロス集計(カテゴリ毎の出現回数・頻度を算出)
print(pd.crosstab(train['Title'], train['Sex']))

screenshot-www-kaggle-com-sublate-taitanic-1588579219238

 

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です