So I have two excel files with only 3 columns in common, and I want to merge the rest of the information to get a new Excel file with all together and ordered, but I can't find a way to get a row and add it to another row
import pandas as pd
df1 = pd.read_excel(r'C:/Users/User/Desktop/UTP/Trabajo Alvaro_Christian/CE.xlsx')
df2 = pd.read_excel(r'C:/Users/User/Desktop/UTP/Trabajo Alvaro_Christian/Matricula.xlsx')
dfs = []
for x in df1:
for y in df2:
if((df1['COD_PERIODO'] == df2['COD_PERIODO']) and (df1['TERCERO'] == df2['TERCERO'])):
dfs.append(????)
dfs.to_excel('FinalData.xlsx')
So I find the matching rows and how do I copy the info of the second row to the first one and make the append to the new dataframe
.