SyntaxFix
Write A Post
Hire A Developer
Questions
You could merge the sub-DataFrame (with just those columns):
df2[list('xab')] # df2 but only with columns x, a, and b df1.merge(df2[list('xab')])