Mar-17-2021, 01:34 PM
This is the code that I use for searching duplicates in my excel sheet :
Best regards,
Eidrizi
def check_duplicacy(first_col):
first_col_list = first_col.tolist()
aux_first_col = []
for i in range(len(first_col_list)):
if not(pd.isnull(first_col_list[i])):
if(first_col_list[i] in aux_first_col):
print('Duplicate found in row nunmber:'+ str(first_col_list[i]))
return first_col_list[i]
else:
aux_first_col.append(first_col_list[i])
print("No duplicacy found")
return ""The code works fine just when I have long list of duplicates it runs for ever. How can I change that the moment find an error stops from the loop.? Best regards,
Eidrizi
