keys : single column or list of columns which will be used as index drop: Bool, default True. Delete the column after creating the index append : Bool, default False. Whether to append column to existing index inplace: Bool, default False. Modify the existing DataFrame or not. verify_integrity : Bool, default False. Check for duplicates.
NAME ID MATH ENGLISH
NAME
Ravi Ravi 1 80 80
Raju Raju 2 40 70
Alex Alex 3 70 40
Ron Ron 4 70 50
King King 5 70 60
Jack Jack 6 30 30
verify_integrity
We have changed the DataFrame by using duplicate value for NAME column. Now if we will set the verify_integrity=True then we will get ValueError like this
ValueError: Index has duplicate keys: Index(['Ron'], dtype='object', name='NAME')
By changing like this verify_integrity=False we can supress the error and continue.