text_plain_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

import seaborn as sns

import warnings

import warnings

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pandas_profiling as pp
import seaborn as sns
import warnings
import os
import warnings
warnings.filterwarnings(action='ignore')
CSV_PATH = '../input/iris-files/iris.csv'

iris = pd.read_csv(CSV_PATH)

nrow = 5
n_feateures = 4
dates = pd.date_range('20220101', periods=nrow, freq='s')
df = pd.DataFrame(np.random.randn(nrow, n_feateures), index=dates, columns=list('ABCD'))
df

t = np.arange(5)
sin_t = np.sin(t)
cos_t = np.cos(t)
exp_t = np.exp(t)
df2 = pd.DataFrame({'t': t, 'sin': sin_t, 'cos': cos_t, 'exp': exp_t})
df2

(df.head(3), df.tail(2), df.columns, df.index, df.shape)

df.loc[:, 'A']

df.iloc[0:2, 3:]

df[df.A < 0]

df1 = pd.DataFrame(np.random.rand(2, 4))
df2 = pd.DataFrame(np.random.rand(1, 4))
df3 = pd.DataFrame(np.random.rand(3, 5))
df_list = [df1, df2, df3]

df4 = pd.concat(df_list, axis=0)
df4

df5 = pd.concat(df_list, axis=1)
df5

iris.groupby('Species').apply(np.mean)

iris = pd.read_csv(CSV_PATH)
iris.to_csv('iris.csv', index=False)

import seaborn as sns
df = pd.read_csv('../input/house-prices-advanced-regression-techniques/train.csv')
df

missing = df.isnull().sum()
missing = missing[missing > 0]
missing.sort_values(inplace=True)
missing_df = pd.DataFrame({'col': missing.index, 'num_missing': missing.values})

plt.figure(figsize=(14,7))
plt.title('Missing Map')
f = sns.barplot(y='col', x='num_missing', data=missing_df)
f.figure

corr = df.drop(['Id'], axis=1).corr()
mask = np.zeros_like(corr, dtype=np.bool)
mask[np.triu_indices_from(mask)] = True
f, ax = plt.subplots(figsize=(11, 11))
cmap = sns.diverging_palette(220, 10, as_cmap=True)
f = sns.heatmap(corr, mask=mask, cmap=cmap, vmax=0.3, center=0, square=True, linewidths=0.5, cbar_kws={'shrink': 0.5})
f.figure