image_output_5.png image_output_4.png image_output_3.png image_output_2.png image_output_1.png
import matplotlib.pyplot as plt

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

import seaborn as sns

train_identity_data = pd.read_csv('../input/train_identity.csv')
train_transaction_data = pd.read_csv('../input/train_transaction.csv')
test_identity_data = pd.read_csv('../input/test_identity.csv')
test_transaction_data = pd.read_csv('../input/test_transaction.csv')

import seaborn as sns
import matplotlib.pyplot as plt

cardTypes = ['discover', 'mastercard', 'visa', 'american express']
for i, i_card in enumerate(cardTypes):
    cardData = eval('train_transaction_data.loc[train_transaction_data["card4"]=="' + i_card + '"]')
    plt.figure(i)
    sns.countplot(cardData['isFraud']).set_title(i_card)