text_html_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

data = pd.read_csv('../input/creditcard/creditcard.csv')

fraud = data[data['Class'] == 1]
normal = data[data['Class'] == 0]

f, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
f.suptitle('Amount per transaction by class')
bins = 50
ax1.hist(fraud.Amount, bins = bins)
ax1.set_title('Fraud')
ax2.hist(normal.Amount, bins = bins)
ax2.set_title('Normal')
plt.xlabel('Amount ($)')
plt.ylabel('Number of Transactions')
plt.xlim((0, 20000))
plt.yscale('log')

plt.boxplot(data.Amount)