Skip to content

Instantly share code, notes, and snippets.

@focaalvarez
Last active November 3, 2021 14:57
Show Gist options
  • Save focaalvarez/de42ff49ddc1d0d28f9bfd9583f709a4 to your computer and use it in GitHub Desktop.
Save focaalvarez/de42ff49ddc1d0d28f9bfd9583f709a4 to your computer and use it in GitHub Desktop.
# Add only 1 column (City)
table1_city=table1.merge(table2[['Person ID','City']],how='left',on='Person ID')
#Add all columns of table 2 (City and language)
table1_all=table1.merge(table2,how='left',on='Person ID')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment