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

df = pd.read_csv('/kaggle/input/paysim1/PS_20174392719_1491204439457_log.csv')
df.columns

fraudcount = df[df['isFraud'] == 1].count()
totalcount = df.count()
fraudcount / totalcount

df_new = df.loc[(df.type == 'TRANSFER') | (df.type == 'CASH_OUT')]
df_new['errorbalanceOrg'] = df_new.newbalanceOrig + df_new.amount - df_new.oldbalanceOrg
df_new['errorbalanceDest'] = df_new.oldbalanceDest + df_new.amount - df_new.newbalanceDest

dfErrorsOrg = df_new[df_new['errorbalanceOrg'] != 0]
dfErrorsOrg[['errorbalanceOrg', 'isFraud']].groupby('isFraud').count()