<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
url = 'https://raw.githubusercontent.com/chrisalbon/simulated_datasets/master/titanic.csv'
df = pd.read_csv(url)
df.head(10)
df.shape

df.describe()
df.loc[1313] = ["Jack", "3rd", 17, "male", 0, 0]
df.loc[1314] = ["Rosa", "3rd", 17, "female", 1, 1]

df.shape<jupyter_output><empty_output><jupyter_text>Давайте добавим и посмотрим, сколько у нас выживших<jupyter_code>df[df['Survived'] == 1].shape
df.groupby('Sex').mean()

df[ (df["Age"] > 17) & (df['PClass'] == "1st") & (df["Age"] < 23)].groupby("Sex").mean()
import matplotlib.pyplot as plt
age = df.groupby("Age").sum()['Survived']
plt.plot(age)


df[ (df["Age"] > 50) & (df['PClass'] == "3rd") & (df["Age"] < 80)].groupby("Sex").mean()
df[ (df["Age"] > 17) & (df['PClass'] == "1st") & (df["Age"] < 38) & (df["Sex"] == "female")].shape

df.insert(6, "quantity", 1) 
import matplotlib.pyplot as plt
age = df.groupby("Age").sum()['Survived']
plt.plot(age)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.248, 'fraction_numerical': 0.038, 'mean_word_length': 6.201438848920863, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '112590', 'license': 'Unlicense', 'n_tokens_mistral': 485, 'n_tokens_neox': 436, 'n_words': 75, 'path': 'Titanik.ipynb', 'repo_name': 'LaraEvdokimova/tests-for-real-laras', 'size': '1000'}