Flipping Data with Pandas: Stack & Unstack

Опубликовано: 05 Июль 2023
на канале: Python and Pandas with Reuven Lerner
3,004
120

Stack and unstack are useful methods that let you reorganize your data frame. But I've found that they're really hard for many people to understand. Which isn't a surprise, given most of the explanations I've seen.

In this video, I show you what stack and unstack do, how to use them, and also why you would use them. You'll see that they're easy to understand and work with, and super useful when you have multi-indexes on your data frames.

There's a small bug in the video, by the way: I tell you not to use inplace=True. But there is no inplace=True for stack and unstack! I'm so used to telling people not to use this keyword argument that I got carried away. Whoops!


Смотрите видео Flipping Data with Pandas: Stack & Unstack онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Python and Pandas with Reuven Lerner 05 Июль 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 3,004 раз и оно понравилось 120 людям.