Selecting Rows in Pandas DataFrame Based on Conditions | GeeksforGeeks

  Рет қаралды 29,446

GeeksforGeeks

GeeksforGeeks

Күн бұрын

In this video, we're going to discuss how to select rows based on some conditions in Pandas DataFrame. There are various methods for doing it such as loc[], iloc[], isin(), etc. ​Let's understand each of them with the help of live examples.
Download the DataSet [media.geeksforgeeks.org/wp-co...]
Check Out the Related Articles:
Selecting rows in Pandas DataFrame based on conditions [www.geeksforgeeks.org/selecti...]
Complete Pandas Tutorial [www.geeksforgeeks.org/pandas-...]
00:00 Let's Start
01:00 Selecting Rows from Pandas DataFrame Using Basic Method
02:15 Selecting Rows from Pandas DataFrame Using loc[]
03:36 Selecting Rows from Pandas DataFrame Using isin()
07:08 Selecting Rows Based on Multiple Column Conditions Using '&' Operator
08:42 Closing Notes
Apply For Video Internship Program - script.geeksforgeeks.org/on-b...
Our courses: practice.geeksforgeeks.org/co...
This video is contributed by Akshit Madan.
Please Like, Comment, and Share the Video with your friends.
#python​​ #pandas​​ #geeksforgeeks #dataframe​​ #datascience​​​​ #eda​​
Install our Android App:
play.google.com/store/apps/de...
If you wish, translate into the local language and help us reach millions of other geeks:
kzbin.info_cs_p...
Follow us on our Social Media Handles -
Twitter- / geeksforgeeks
LinkedIn- / geeksforgeeks
Facebook- / geeksforgeeks.org
Instagram- geeks_for_g...
Reddit- / geeksforgeeks
Telegram- t.me/s/geeksforgeeks_official
Also, Subscribe if you haven't already! :)

Пікірлер: 22
@GeeksforGeeksVideos
@GeeksforGeeksVideos 3 жыл бұрын
Apply For Video Internship Program - script.geeksforgeeks.org/on-boarding/youtube
@j3553hh
@j3553hh 7 ай бұрын
Why use .loc when we get the same results just using df[df[? That's something I can't quite understand. Thank you for the video. Concise and informative.
@simplica1
@simplica1 2 жыл бұрын
Thank you very much! This was very helpful. It looks like the basic method and the loc method do exactly the same thing!
@Cruton2025
@Cruton2025 Жыл бұрын
isin method was super helpful, thanks guys
@ceejinx1701
@ceejinx1701 Жыл бұрын
Thanks a lot! It helped me with our assignment about Selecting Rows and you the best!
@kennethstephani692
@kennethstephani692 Жыл бұрын
Great video!
@ahmadrijal4850
@ahmadrijal4850 Жыл бұрын
Thanks a lot! Very helpful
@thelumusajamesmthethwa2983
@thelumusajamesmthethwa2983 3 ай бұрын
Thank you so much
@aliebrahimi98
@aliebrahimi98 2 жыл бұрын
thanks for the video. What about if you need to check two columns and if the value of the list isin either one?
@9sunz
@9sunz 2 жыл бұрын
Hi there. Great work! I want to know if there is a lambda function to achieve what we did in this video? Another thing, if one wants to create a new variable from multiple conditions and also separating few columns from total of let's say 100 columns, what's the best way to do it? for example, we have columns A to Z. And we want to sort Column B and Column C with conditions, B>0.5, and C
@adrijroy9592
@adrijroy9592 Жыл бұрын
The video is very informative. If we want to select rows based upon time of arrival/departure, how can we do it? Please suggest. Thanks.
@khoubabioki
@khoubabioki 2 жыл бұрын
Excellent
@HuyenPhanThanh-jy8pq
@HuyenPhanThanh-jy8pq Жыл бұрын
thanks a lot for your useful video. I wonder that whether this selecting method can be used for searching assignment ? and I dont know how to search for a month '6' and it still shows the result comprises year,month,day.
@esguerrapiper
@esguerrapiper Жыл бұрын
if the column is zip code / post code and I want to select the first two characters what is the code for that? for example under column post code I want to show post code that start with NG
@meharunnisa5867
@meharunnisa5867 Жыл бұрын
Lets suppose we get only those rows whose indexs contain 7 then what condition is for?
@adrijroy9592
@adrijroy9592 Жыл бұрын
Also if we want to select employees who came after 10 am say, how to do it?
@ankitsrivastava06
@ankitsrivastava06 Жыл бұрын
How to know that when I choose range between slab as eg: 0 to 5 as 0 5 to 10 as 1 , 10 to 24 as 2 etc Based on column wise ? Scoring purpose for analysis
@thirumuruga8964
@thirumuruga8964 Жыл бұрын
I need sale 2 person,product 5 person and Others each is 3 how to I calculate
@rishabhsardi7973
@rishabhsardi7973 Жыл бұрын
m getting this Error while putting condition: 'SyntaxError: cannot assign to subscript here. Maybe you meant '==' instead of '='?' Syntax: DF = DF22.[DF22['sub_code']=1930]
@nitishbhardwaj6498
@nitishbhardwaj6498 Жыл бұрын
How to. Know that Larry belongs to Business development team?
@nevilledoke6683
@nevilledoke6683 2 жыл бұрын
for example u have 1 excel sheet and it consist of 10000 data in it. Later when we import that excel file in pycharm or jupiter notebook. if i run that file i will get an Index range also know as Row labels. my python code should be able to read that ten thousand row labels and should be able to separate / split into 10 different excel sheet files which will have 1000 data in each of the 10 saperated sheet. other example is, if there is 9999 data in 1 sheet then my python code should divide 9000 data in 9 sheet and other 999 in other sheet without any mistakes. i am asking this because in my data there is not any unique values for my code to split the files using .unique plz help i have search the whole YT , stackoverflow, and github tooo from 3 days
@mukeshmourya9460
@mukeshmourya9460 3 жыл бұрын
Hii
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 50 МЛН
How do I select multiple rows and columns from a pandas DataFrame?
21:47
How to use groupby() to group categories in a pandas DataFrame
6:57
Chart Explorers
Рет қаралды 120 М.
How to filter a pandas DataFrame | 6 HELPFUL METHODS
17:27
Chart Explorers
Рет қаралды 28 М.
Advanced String Searching including RegEx (Pandas Tutorials 06)
12:37
Python Tutorials for Digital Humanities
Рет қаралды 10 М.
Data Cleaning in Pandas | Python Pandas Tutorials
38:37
Alex The Analyst
Рет қаралды 258 М.
Python Pandas: Select, SLICE & FILTER Data rows & columns by Index or Conditionals
24:39
Oggi AI - Artificial Intelligence Today
Рет қаралды 33 М.
⬅️🤔➡️
00:31
Celine Dept
Рет қаралды 50 МЛН