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"))반응형
'Python' 카테고리의 다른 글
| [Python] Using Telegram Bot API (0) | 2022.05.13 |
|---|---|
| [Python] Usage of .env (0) | 2022.04.23 |
| [Python] Pandas Course on Kaggle - 5 (0) | 2022.01.21 |
| [Python] Pandas Course on Kaggle - 4 (0) | 2022.01.20 |
| [Python] Pandas Course on Kaggle - 3 (0) | 2022.01.19 |
댓글