text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

data = pd.read_csv('../input/openintro-possum/possum.csv')

data.shape

data.isna().sum()

data.dropna(axis=0, inplace=True)

data.columns

data.replace(to_replace={'Vic': 'Victoria', 'm': 'male', 'f': 'female'}, inplace=True)

data = data.rename(columns={'Pop': 'pop'})

list_of_cat_unordered_features = data[['site', 'pop', 'sex']]

for feature in list_of_cat_unordered_features:
    plt.figure(figsize=(12,6.5))
    plt.title(feature, fontsize=15, fontweight='bold', fontname='Helvetica', ha='center')
    ax = sns.countplot(x = data[feature], data=data, order = data[feature].value_counts().index)
    for container in ax.containers:
        ax.bar_label(container)
    plt.show()

list_of_num_features = data[['age', 'hdlngth', 'skullw', 'totlngth', 'taill', 'footlgth', 'earconch', 'eye', 'chest', 'belly']]
for feature in list_of_num_features:
    plt.figure(figsize=(12, 6.5))
    plt.title(feature, fontsize=15, fontweight='bold', fontname='Helvetica', ha='center')
    ax = sns.boxplot(y=data[feature], data=data)
    for container in ax.containers:
        ax.bar_label(container)
    plt.show()