Pandas give you many ways to filter your data. In this video, you will learn how to filter your dataframe rows by condition like a boss.
What is Pandas? A Python data analysis library
If you are looking to sort your data, please see my other video below:
• Pandas Sort - How to Order Your DataF...
We start the video by creating a simple dataframe that contains two columns. One column holds letters and the other holds integers.
Pandas Filter Example #1:
Here we try to only select the rows that have the letter "a". After the filter is created, we then show how we can apply the filter to your pandas dataframe. The result should only be the rows that have the letter "a".
Pandas Filter Example #2:
We step the difficulty up one notch. A second filter is created and we then show how it is possible to apply multiple filters on the same dataframe. The conditions applied to each row can be a union of the two filters or one or the other.
The last example just stacks another filter on top of the two already applied to the rows. We also show how to do the opposite which could be beneficial at times. These simple examples should give you confidence and motivate you to slice and dice your own data sets.
🔥 Free Pandas Course: https://hedaro.gumroad.com/l/tqqfq
Смотрите видео Pandas Filter - How I Filter Rows by Condition онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Learn Pandas 20 Октябрь 2018, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,256 раз и оно понравилось 75 людям.