Created
December 13, 2021 17:38
-
-
Save thepycoach/da42b7807d8d3491fdd8f08be0fffeb3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Imported StudentsPerformance_id.csv | |
| import pandas as pd | |
| StudentsPerformance_id_csv = pd.read_csv(r'StudentsPerformance_id.csv') | |
| # Imported LanguageScore.csv | |
| import pandas as pd | |
| LanguageScore_csv = pd.read_csv(r'LanguageScore.csv') | |
| # Merged LanguageScore_csv and StudentsPerformance_id_csv | |
| temp_df = StudentsPerformance_id_csv.drop_duplicates(subset='id') # Remove duplicates so lookup merge only returns first match | |
| df3 = LanguageScore_csv.merge(temp_df, left_on=['id'], right_on=['id'], how='left', suffixes=['_LanguageScore_csv', '_StudentsPerformance_id_csv']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment