In the following script
import pandas as pd
def start():
df_dict = {"A": [1,2,3,3,4], "B": [1,2,2,3,4]}
df = pd.DataFrame(df_dict)
df.drop_duplicates(inplace = True, keep = "last")
print(df)
if __name__ == "__main__":
start()
The duplicates in df are not removed. What could be the reason
Current output:
A B
0 1 1
1 2 2
2 3 2
3 3 3
4 4 4
Expected output:
A B
0 1 1
1 2 2
3 3 3
4 4 4