Skip to content

Instantly share code, notes, and snippets.

@pranjalAI
Created August 13, 2021 18:10
Show Gist options
  • Save pranjalAI/52deda9e3456ed8ee132b2d818489d15 to your computer and use it in GitHub Desktop.
Save pranjalAI/52deda9e3456ed8ee132b2d818489d15 to your computer and use it in GitHub Desktop.
Total_transactions = len(data)
normal = len(data[data.Class == 0])
fraudulent = len(data[data.Class == 1])
fraud_percentage = round(fraudulent/normal*100, 2)
print(cl('Total number of Trnsactions are {}'.format(Total_transactions), attrs = ['bold']))
print(cl('Number of Normal Transactions are {}'.format(normal), attrs = ['bold']))
print(cl('Number of fraudulent Transactions are {}'.format(fraudulent), attrs = ['bold']))
print(cl('Percentage of fraud Transactions is {}'.format(fraud_percentage), attrs = ['bold']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment