text_plain_output_1.png
import pandas as pd

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

main_df = pd.read_csv('/kaggle/input/creditcardfraud/creditcard.csv')
df = main_df.copy()

df.isnull().sum()

legit = df[df.Class == 0]
fraud = df[df.Class == 1]

legit_sample = legit.sample(n=492)

new_df = pd.concat([legit_sample, fraud], axis=0)

new_df.shape

new_df['Class'].value_counts()