from ctgan import CTGAN
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
from sklearn import metrics 
from sklearn.metrics import *
from sklearn.neural_network import MLPClassifier
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from time import time
import sys
################
###############################
###Read data and preprocessing
################################
dbName = 'keystroke_51_DataSet_Processd_28-5-2023A.csv'

#print(dbName)
###############################
###Read data and preprocessing
################################
ds=pd.read_csv(dbName)         
#print(ds.head())
print(np.shape(ds))

#If you want to see which columns has nulls and which do not(just True and False)
print(ds.isnull().any())

#If you want to see only the columns that has nulls
print(ds.loc[:, ds.isnull().any()].columns)

#If you want to see the count of nulls in every column
#print(ds.isna().sum())

#If you want to see the percentage of nulls in every column
#print(ds.isna().sum()/(len(ds))*100)

ds = ds.dropna(how='any')    #to drop if any value in the row has a nan
#dat.dropna(how='all')    #to drop if all values in the row are nan
#print(ds.isnull().any())


ds = ds.dropna(how='any')    #to drop if any value in the row has a nan
print(np.shape(ds))
