Answers for "find common columns in two dataframes pandas "merge""

0

merge two dataframes with common columns

import pandas as pd
pd.merge(df1, df2, on="movie_title")
Posted by: Guest on August-20-2020
0

identify the common columns between two dataframes pandas python

a = np.intersect1d(df2.columns, df1.columns)
print (a)
['B' 'C']

a = df2.columns.intersection(df1.columns)
print (a)
Index(['B', 'C'], dtype='object')
Posted by: Guest on November-28-2021
0

merge two dataframes with common columns

dfinal = df1.merge(df2, how='inner', left_on='movie_title', right_on='movie_name')
Posted by: Guest on August-20-2020

Code answers related to "find common columns in two dataframes pandas "merge""

Python Answers by Framework

Browse Popular Code Answers by Language