In [1]:
## create data
import numpy as np
import pandas as pd
from sklearn.datasets import load_boston


boston = load_boston()
X = pd.DataFrame(
    boston.data,
    columns=boston.feature_names,
)
X.replace(0, np.NaN, inplace=True)

## count missing values
missing_count=X.apply(
    lambda x: (
        x.isna().sum()
    )
)

## proportion missing values
missing_proportion = X.apply(
    lambda x: (
        x.isna().mean()
    )
)

## create Result DataFrane 
result = pd.DataFrame(
    dict(
        missing_count=missing_count,
        missing_proportion=missing_proportion,
    )
)

display(result)
missing_count missing_proportion
CRIM 0 0.000000
ZN 372 0.735178
INDUS 0 0.000000
CHAS 471 0.930830
NOX 0 0.000000
RM 0 0.000000
AGE 0 0.000000
DIS 0 0.000000
RAD 0 0.000000
TAX 0 0.000000
PTRATIO 0 0.000000
B 0 0.000000
LSTAT 0 0.000000
In [ ]: