I have a dataframe and have removed duplicate rows using .drop_duplicates() method. But the initial index of the rows and still the same.
data = data.drop_duplicates(keep=False, inplace=True)
id Name Designation DOB
2 7934 'MILLER' 'CLERK' 7782.0 '23-JAN-82' 1300 10
8 7521 'WARD' 'SALESMAN' 7698.0 '22-FEB-81' 1250 500.0 30
9 7902 'FORD' 'ANALYST' 7566.0 '3-DEC-81' 3000 20
10 7876 'ADAMS' 'CLERK' 7788.0 '12-JAN-83' 1100 20
11 7566 'JONES' 'MANAGER' 7839.0 '2-APR-81' 2975 20
12 7698 'BLAKE' 'MANAGER' 7839.0 '1-MAY-81' 2850 30
17 7839 'KING-WEB' 'PRESIDENT' '17-NOV-81' 15000 10
I want to re-index all the rows like this:
id Name Designation DOB
1 7934 'MILLER' 'CLERK' 7782.0 '23-JAN-82' 1300 10
2 7521 'WARD' 'SALESMAN' 7698.0 '22-FEB-81' 1250 500.0 30
3 7902 'FORD' 'ANALYST' 7566.0 '3-DEC-81' 3000 20
4 7876 'ADAMS' 'CLERK' 7788.0 '12-JAN-83' 1100 20
5 7566 'JONES' 'MANAGER' 7839.0 '2-APR-81' 2975 20
6 7698 'BLAKE' 'MANAGER' 7839.0 '1-MAY-81' 2850 30
7 7839 'KING-WEB' 'PRESIDENT' '17-NOV-81' 15000 10