text_plain_output_1.png
import matplotlib.pyplot as plt

import os

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

import warnings

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
import seaborn as sns
from collections import Counter
import warnings
warnings.filterwarnings('ignore')
import os

train_df = pd.read_csv('/kaggle/input/titanic/train.csv')
test_df = pd.read_csv('/kaggle/input/titanic/test.csv')
test_PassengerId = pd.read_csv('/kaggle/input/titanic/gender_submission.csv')

train_df.columns

def bar_plot(variable):
    """
    input: variable eg: "Sex"
    output: bar plot & value count
    """
    var = train_df[variable]
    varValue = var.value_counts()
    plt.xticks(varValue.index, varValue.index.values)

category1 = ['Survived', 'Sex', 'Pclass', 'Embarked', 'SibSp', 'Parch']
for c in category1:
    bar_plot(c)