Answers for "pandas merge drop duplicate row"

8

remove duplicate row in df

df = df.drop_duplicates()
Posted by: Guest on August-19-2020
0

pd.merge duplicate columns remove

#Create test data
df1 = pd.DataFrame(np.random.randint(100,size=(1000, 3)),columns=['A','B','C'])
df2 = pd.DataFrame(np.random.randint(100,size=(1000, 3)),columns=['B','C','D'])

pd.merge(df1, df2, how='inner', left_on=['B','C'], right_on=['B','C'])
Posted by: Guest on July-07-2021

Code answers related to "pandas merge drop duplicate row"

Python Answers by Framework

Browse Popular Code Answers by Language