# ---
# 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 pandas as pd 

# ls -lah

train = pd.read_csv('lesson_01/00_titanic_train.csv')

train

train.shape

train.columns

train.index

train.head(4).T


transpose_train = train.T

print(transpose_train.index)
print(transpose_train.columns)

train.info()

# + active=""
# import numpy
# -

import numpy
from collections import Counter

t = train.describe()

t['Survived'].astype('int')

train.describe(percentiles=[0.99])

tmp = train[
    train['Embarked'].isin(['Q','C']) & (train['Age'] < 40)
].head()

tmp

train.sort_values('Fare')

train[['Age', 'Sex']].groupby('Sex').mean()


train.pivot_table('PassengerId', 'Pclass', 'Survived', 'count')

# %matplotlib inline

from matplotlib import pyplot as plt 

plt.plot([1,2,3,4])

plt.plot([4,2,1,3], [1,3,2,4], '-')

plt.hist([1,2,3,1,3,1,4,4,5,5,5])

import pandas as pd
df = pd.read_csv('lesson_01/00_sberbank_macro.csv')

df

df[~df['mortality'].isnull()]['mortality'].hist()

df['rent_price_1room_eco'].hist(bins=100)

tmp = df[['timestamp', 'oil_urals', 'gdp_quart_growth']]

tmp.info()

tmp.set_index('timestamp').plot()

tmp.hist()

plt.plot(
    df[~df['gdp_quart_growth'].isnull()]['gdp_quart'],
    df[~df['gdp_quart_growth'].isnull()]['oil_urals'],
    '.'
)

import seaborn as sns





StarcoderdataJupyterScriptsDedupFiltered