Created
March 24, 2020 12:15
-
-
Save allatambov/5a4cb3970c47f845dfa76af572f063fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
harry = hp[hp['Name'] == 'Harry Potter'] | |
ron = hp[hp['Name'] == 'Ronald Weasley'] | |
pd.concat([harry, ron], axis = 1) | |
pd.concat([hp[['Name', 'Subject']], hp[['Mark', 'Comment']]], axis=1) | |
df1 = pd.read_excel("HP_two.xlsx") | |
df2 = pd.read_excel("HP_three.xlsx") | |
pd.merge(df1, df2, on=['Name', 'Subject']) | |
pd.merge(df1, df2, on=['Name', 'Subject'], how='inner') | |
pd.merge(df1, df2, on=['Name', 'Subject'], how='outer') | |
pd.merge(df1, df2, on=['Name', 'Subject'], how='left') | |
pd.merge(df1, df2, on=['Name', 'Subject'], how='right') | |
pd.merge(df1, df2, on='Name', how='inner') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment