text_plain_output_1.png
import pandas as pd

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('../input/spaceship-titanic/train.csv')
test = pd.read_csv('../input/spaceship-titanic/test.csv')
submission = pd.read_csv('../input/spaceship-titanic/sample_submission.csv')
RANDOM_STATE = 12
STRATEGY = 'median'

train.shape

train.count()

train.isna().sum()

train.drop(columns=['PassengerId'], inplace=True)
test.drop(columns=['PassengerId'], inplace=True)
TARGET = 'Transported'
FEATURES = [col for col in train.columns if col != TARGET]
RANDOM_STATE = 12

train.iloc[:, :-1].describe().T.sort_values(by='std', ascending=False)

test.isna().sum()

test_null = pd.DataFrame(test.isna().sum())

train_null = pd.DataFrame(test.isna().sum())
train_null = train_null.sort_values(by=0, ascending=False)[:-1]

missing_train_row = train.isna().sum(axis=1)
missing_train_row = pd.DataFrame(missing_train_row.value_counts() / train.shape[0]).reset_index()

missing_train_row