Answers for "remove duplicate rows in a dataframe python no index"

0

pandas remove repeated index

df[~df.index.duplicated()]
Posted by: Guest on August-17-2020
0

dataframe delete duplicate rows with same column value

df = df.drop_duplicates(subset=['Column1', 'Column2'], keep='first')

# Exemple
import pandas as pd
df = pd.DataFrame({"A":["foo", "foo", "foo", "bar"], "B":[0,1,1,1], "C":["A","A","B","A"]})
df.drop_duplicates(subset=['A', 'C'], keep=False)
Posted by: Guest on December-17-2021

Code answers related to "remove duplicate rows in a dataframe python no index"

Python Answers by Framework

Browse Popular Code Answers by Language