I am doing a following left join
left_join = left.merge(right, how="left", left_on=[attr1], right_on=[attr2])
How can I now get names of columns that belong only to a right table in left join? pandas sometimes renames columns if we bring same name column so I cannot just get the names of columns from right table. Also since we merge on one attribute one of the columns will not be present, thus I need to somehow extract them from left_join.
Thank you!
EDIT: My solution was simpler than I expected. I solved it as
names = left_join.columns.values
names[left.shape[1]:]