I have been searching online and found similar questions but still couldn't find the answer to what I'm looking for. I have 2 excel files:
data1
ColumnA columnB columnC columnD A B C D A B C D A B C D data2
ColumnE columnF columnG E F G E F G E F G I want to add the column F from data2 to data1:
ColumnA columnB columnC columnD columnF A B C D F A B C D F A B C D F I tried
data2['columnF'] = data1['columnF'] #doesn't work also tried
data1['columnF'] = '' #adding a columnF to data1 merg_left = pd.merge(left=data1,right=data2, how='left', left_on='columnF', right_on='columnF') #gave me a weird output file
data2['columnF'] = data1['columnF']would work. Are the same shape? Do they have some common index?pd.concatis probably what you want to use but until we know what the indices and shape are we can't tell you exactly how to use it.