Python
[Python] Pandas Course on Kaggle - 6
llHoYall
2022. 1. 22. 12:09
This is the solution of pandas course (Renaming and Combining) on Kaggle site.
1. Rename Columns

renamed = reviews.rename(columns={'region_1': 'region', 'region_2': 'locale'})
2. Rename an Index

reindexed = reviews.rename_axis('wines', axis='rows')
3. Combine Data Frames

combined_products = pd.concat([gaming_products, movie_products])
4. Combine Data Frames by Index

powerlifting_combined = powerlifting_meets.set_index("MeetID")
.join(powerlifting_competitors.set_index("MeetID"))반응형