# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import sys
import pandas as pd
import os
from pprint import pprint as pp
df = pd.read_csv("titanic.csv")
# !python3.7 --version


pp([sys.version, os.getcwd(), df.head()])

df.drop(df.columns[[2]], axis=1, inplace=True)
pp(df.head())

pp([df.iloc[0], df.iloc[0:8], df.loc[:, ['passenger_id']]])

df = pd.read_csv("titanic.csv")
meanagedf = df.groupby(["pclass"])["age"].mean().reset_index()
pp((df.head(), df.loc[:,['name', 'age']], df[df["name"] == "Hoyt, Mr. <NAME>" ], df.groupby(["sex", "survived"])["passenger_id"].count(), df.groupby(["pclass"])["age"].mean(),
meanagedf))

print(df.head())

df.drop(df.columns[[0,2]], axis=1, inplace=True)
# df.drop(df.columns([0]), axis=1, inplace=True)

print(df.head())

# ### Pandas Key Functions/Methods
# ### isnull() dropna() fillna() duplicated() drop_duplicates() set_index()

StarcoderdataJupyterScriptsDedupFiltered