Reshaping Data with pandas
Reshape DataFrames from a wide to long format, stack and unstack rows and columns, and wrangle multi-index DataFrames.
Commencer Le Cours Gratuitement4 heures15 vidéos52 exercices17 798 apprenantsDéclaration de réalisation
Créez votre compte gratuit
ou
En continuant, vous acceptez nos Conditions d'utilisation, notre Politique de confidentialité et le fait que vos données sont stockées aux États-Unis.Formation de 2 personnes ou plus ?
Essayer DataCamp for BusinessApprécié par les apprenants de milliers d'entreprises
Description du cours
Often data is in a human-readable format, but it’s not suitable for data analysis. This is where pandas can help—it’s a powerful tool for reshaping DataFrames into different formats. In this course, you’ll grow your data scientist and analyst skills as you learn how to wrangle string columns and nested data contained in a DataFrame. You’ll work with real-world data, including FIFA player ratings, book reviews, and churn analysis data, as you learn how to reshape a DataFrame from wide to long format, stack and unstack rows and columns, and get descriptive statistics of a multi-index DataFrame.
Formation de 2 personnes ou plus ?
Donnez à votre équipe l’accès à la plateforme DataCamp complète, y compris toutes les fonctionnalités.Dans les titres suivants
Manipulation de données en Python
Aller à la pisteImportation et nettoyage des données en Python
Aller à la piste- 1
Introduction to Data Reshaping
GratuitLet's start by understanding the concept of wide and long formats and the advantages of using each of them. You’ll then learn how to pivot data from long to a wide format, and get summary statistics from a large DataFrame.
Wide and long data formats50 xpThe long and the wide100 xpFlipping players100 xpReshaping using pivot method50 xpDribbling the pivot method100 xpOffensive or defensive player?100 xpReplay that last move!100 xpPivot tables50 xpReviewing the moves100 xpExploring the big match100 xpThe tallest and the heaviest100 xp - 2
Converting Between Wide and Long Format
Master the technique of reshaping DataFrames from wide to long format. In this chapter, you'll learn how to use the melting method and wide to long function before discovering how to handle string columns by concatenating or splitting them.
Reshaping with melt50 xpGothic times100 xpRating is not everything100 xpHow is Frankenstein, Dorian Gray?100 xpWide to long function50 xpThe golden age100 xpDecrypting the code100 xpTime to read, Katniss!100 xpWorking with string columns50 xpDid you say dystopia?100 xpWhat's your rating, Harry?100 xpElementary, dear Watson!100 xp - 3
Stacking and Unstacking DataFrames
In this chapter, you’ll level-up your data manipulation skills using multi-level indexing. You'll learn how to reshape DataFrames by rearranging levels of the row indexes to the column axis, or vice versa. You'll also gain the skills you need to handle missing data generated in the stacking and unstacking processes.
Stacking DataFrames50 xpStack the calls!100 xpPhone directory index100 xpText me!100 xpUnstacking DataFrames50 xpInternational caller100 xpCall another time100 xpOrganizing your voicemail100 xpWorking with multiple levels50 xpSwap your SIM card100 xpTwo many calls100 xpHandling missing data50 xpA missed phone call100 xpDon't drop the stack100 xp - 4
Advanced Reshaping
You'll finish by learning how to combine the reshaping process with grouping to produce quick data manipulations. Lastly, you'll discover how to transform list-like columns and handle complex nested data, such as nested JSON files.
Reshaping and combining data50 xpLess fast food, please!100 xpOnly going up100 xpA group analysis100 xpTransforming a list-like column50 xpMerge it all100 xpExplode the bounds100 xpThe good old split100 xpReading nested data into a DataFrame50 xpNested movies100 xpA complex film100 xpDealing with nested data columns50 xpUn-nesting birds100 xpDon't dump the bird100 xpThe final reshape50 xp
Formation de 2 personnes ou plus ?
Donnez à votre équipe l’accès à la plateforme DataCamp complète, y compris toutes les fonctionnalités.Dans les titres suivants
Manipulation de données en Python
Aller à la pisteImportation et nettoyage des données en Python
Aller à la pistecollaborateurs
prérequis
Data Manipulation with pandasMaria Eugenia Inzaugarat
Voir PlusData Scientist and Artificial Intelligence Consultant
Qu’est-ce que les autres apprenants ont à dire ?
Inscrivez-vous 15 millions d’apprenants et commencer Reshaping Data with pandas Aujourd’hui!
Créez votre compte gratuit
ou
En continuant, vous acceptez nos Conditions d'utilisation, notre Politique de confidentialité et le fait que vos données sont stockées aux États-Unis.