Python Pandas Tutorial (Part 4): Filtering - Using Conditionals to Filter Rows and Columns

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024

ความคิดเห็น • 320

  • @darshantawte7435
    @darshantawte7435 4 หลายเดือนก่อน +19

    Even in 2024 this is still the best tutorial out there for pandas. With AI becoming capable of performing EDA and data analysis (atleast elementary which is still better than many newbie analysts), i wonder how pandas will keep up with it.

    • @douma8037
      @douma8037 หลายเดือนก่อน

      bro but i guess building large scale AI models from scratch will definitely need pandas regardless of AI being able to do EDA and Data Analysis

    • @darshantawte7435
      @darshantawte7435 หลายเดือนก่อน

      @@douma8037 Yeah data cleaning will play a major role even in the future.

    • @douma8037
      @douma8037 หลายเดือนก่อน

      @@darshantawte7435 yes! We’d need pandas for that.. unless some AI comes into play of course..

  • @qualjyn2
    @qualjyn2 4 ปีที่แล้ว +266

    Nothing like waking up a Saturday morning, and catching up on Coreys Python Pandas tutorial over a good cup of coffee :) @Corey, keep up the good work - it is really appreciated!

    • @sidneysousa3520
      @sidneysousa3520 4 ปีที่แล้ว +11

      I said it! This is like Netflix :)

    • @onyekachinelson6999
      @onyekachinelson6999 2 ปีที่แล้ว +1

      Okay. Today is Saturday. Lemme watch it and see for myself. Thanks!

    • @onyekachinelson6999
      @onyekachinelson6999 2 ปีที่แล้ว +2

      The lesson is fantastic 👏

  • @cordularaecke
    @cordularaecke 4 ปีที่แล้ว +131

    This is the best explanation of pandas dataframe boolean filtering I've ever seen - especially the inverse filter using the tilde - excellent - this is SO useful. Thank you

  • @parols1160
    @parols1160 4 ปีที่แล้ว +76

    I guess 'flawless' is the only appropriate adjective for this whole series you are doing. Congrats from Italy Corey, keep it real!

  • @nascentnaga
    @nascentnaga 4 หลายเดือนก่อน +9

    this is fresh in 2024 :)

  • @tolulopeadedoyinadedoyin5239
    @tolulopeadedoyinadedoyin5239 3 ปีที่แล้ว +22

    Corey is the best tutor , I have seen so far....He explains with ease and simplicity....More grace

  • @in_ashish
    @in_ashish หลายเดือนก่อน +2

    Corey is the reason i will be able to earn my bread and butter. Can't thank enough!

  • @mintymintfresh
    @mintymintfresh 3 ปีที่แล้ว +7

    There is no better teacher on python than corey... He is simply the best one... I got to learn flask .. All thanks to corey.. There are thousands of students whom u are making a better programmer every day ...

  • @user-bf8zz9qb8u
    @user-bf8zz9qb8u หลายเดือนก่อน +1

    I think it is the best tutorial i have ever seen in youtube. Good explanation sir.

  • @ashylarry3442
    @ashylarry3442 4 ปีที่แล้ว +5

    I let your ads play all the way thru. Fives minutes in exchange for what you’re giving...light work. Keep it up brotha!

  • @shanplays6001
    @shanplays6001 4 ปีที่แล้ว +17

    Great series. I would recommend going through these tutorials once with the given dataset, and then going through it again using a dataset you're interested in. Dw, it will go alot faster the 2nd time around, and you'll get great practice actually finding insights you care about.

  • @akiratoriyama1320
    @akiratoriyama1320 4 ปีที่แล้ว +13

    Like THE BEST pandas tutorial on internet. Thanks again Corey!!

  • @j3553hh
    @j3553hh ปีที่แล้ว

    Your videos are so rich with practical guidance that I'm pausing every 90 seconds to make notes. This one took me three hours to get through.

  • @Shailswap14
    @Shailswap14 4 ปีที่แล้ว +2

    I have referred to three video tutorials/courses before this and this is by far the best course on pandas with complete coverage.
    You deserve a million likes for this series. This course is priceless.

  • @JoshuaDHarvey
    @JoshuaDHarvey 4 ปีที่แล้ว +8

    19:22 let us know when you do a video on strings! Can't wait for that and if you need any suggestions on any of the methods in the pandas .../text.html let us know! Thanks for all your hard work Corey!

  • @edilgin622
    @edilgin622 4 ปีที่แล้ว +3

    i started learning python basics with you and i just cant believe how much i improved myself this year, thanks a lot!

  • @motlatsimoea5615
    @motlatsimoea5615 2 ปีที่แล้ว +1

    Of all the teachers I have come across on TH-cam, you are my favorite. The way you explain. The example exercises you use are simple enough to comprehend while also making me feel like I could handle bigger problems.
    I learned Django from you as well. Thank you for all your work!

  • @Lars7878
    @Lars7878 4 ปีที่แล้ว +5

    I love that .Str.contains filter, that is a brilliant idea, I never came up with.

  • @larz4437
    @larz4437 4 ปีที่แล้ว +11

    The often imitated, never duplicated, Corey Schafer. You're truly the python guide GOAT and us noobs bow before you. Thank you so much for this series and all your work.

  • @pierreroux-lafargue8227
    @pierreroux-lafargue8227 4 ปีที่แล้ว +5

    You're a good man Corey Schafer, thanks for the quality content.

  • @Historiaplaying
    @Historiaplaying 4 ปีที่แล้ว

    Corey, you're a god of teaching, you don't leave out anything unexplained. Thank you

  • @niralpatel3369
    @niralpatel3369 4 ปีที่แล้ว +6

    You're a great man Corey Schafer, This is the best channel ever on TH-cam.
    Thanks form India.

  • @cudanakiju0
    @cudanakiju0 3 ปีที่แล้ว +4

    I'm reviewing your tutorial for my interview, that's awesome!
    Just to clarify one thing (part staring at ~7:00) - when combining conditions, you MUST put separate conditions into parenthesis, otherwise pandas will most likely throw quite ugly and non-intuitive error. I think that should be stressed, wasted some time on it once ;)

  • @sergiomunozblanco3843
    @sergiomunozblanco3843 3 ปีที่แล้ว

    I don't understand the people that vote negative to these video lectures. They are really clear, they are concise, they are practical and they are interesting. Why?

    • @kapibara2440
      @kapibara2440 6 หลายเดือนก่อน

      These must be some internet troll, no need to thank about them. Just ignore them.

  • @pythonstuff8633
    @pythonstuff8633 4 ปีที่แล้ว +2

    Bro you have no idea what help you are giving us.Thank You Keep doing what you do!

  • @josephsteen230
    @josephsteen230 4 ปีที่แล้ว +7

    As per your request: I would like to see you upload a video about truth tables. I like the way you explain things, Corey. Your Panda series is helping a lot. So thanks for what you do!

  • @TopBagon
    @TopBagon 4 ปีที่แล้ว +7

    Your tutorials are the best ones I've ever seen in my life ._. thanks you so much for those, we appreciate this a lot
    *Simply Amazing*

  • @KeithFlint350
    @KeithFlint350 2 ปีที่แล้ว +2

    4:20 if the filter is saved as a variable then you can easily use it many times in the code. Doesn't matter for a presentation at school, but matters a lot when you're building an actual app

  • @akintonaolawalesamuel2236
    @akintonaolawalesamuel2236 4 ปีที่แล้ว +2

    Lucid. Concise. Thanks a bunch, Corey, for all you do to make us Pythonistas

  • @jeanaimegakwerere5359
    @jeanaimegakwerere5359 6 หลายเดือนก่อน

    Love how you filtered comma rows with comma separated data👋

  • @JoshuaMurangaBauer
    @JoshuaMurangaBauer ปีที่แล้ว

    Your contents will never go obsolate mate. Pure Gold.

  • @kapibara2440
    @kapibara2440 6 หลายเดือนก่อน +1

    Your audience is also from Poland. Thank you Corey :)

    • @Cloudjiek
      @Cloudjiek 25 วันที่ผ่านมา

      I second that!

  • @chrissteele9540
    @chrissteele9540 4 ปีที่แล้ว +7

    You have a way of making any topic seem sooo simple... You're an incredible teacher! I owe most of my python skills to you btw ─ thanks :)
    Please keep the videos coming!

  • @nicholasmaloof8378
    @nicholasmaloof8378 4 ปีที่แล้ว +133

    Would you be willing to do a video on numpy?

    • @JoshuaDHarvey
      @JoshuaDHarvey 4 ปีที่แล้ว +1

      I'm pretty new to python in general but isn't most of pandas built on numpy, so I imagine there is quite a bit of common ground between the two libs?

    • @jeetpatel6679
      @jeetpatel6679 4 ปีที่แล้ว +8

      th-cam.com/video/QUT1VHiLmmI/w-d-xo.html his tutorial is good

    • @deepdoshi2734
      @deepdoshi2734 4 ปีที่แล้ว +1

      @@jeetpatel6679 Thank you

    • @sensei249
      @sensei249 4 ปีที่แล้ว +1

      @@jeetpatel6679 that's the best available video for numpy, even i was going to suggest it. after 1 hour lecture you are ready to go.

    • @alenjose3903
      @alenjose3903 4 ปีที่แล้ว

      @@jeetpatel6679 thanks

  • @YeekyYeeky
    @YeekyYeeky 4 ปีที่แล้ว +2

    Corey Schafer is really great at explaining things , thank you very much !

  • @fuzzywuzzy318
    @fuzzywuzzy318 3 ปีที่แล้ว +1

    I'am from china !!!!!I am your new audiance ,and feel your video is really helpful!!!!!!!thanks!!!

  • @robertobr234
    @robertobr234 2 ปีที่แล้ว

    I have watched this video many times. When I forget how to use LOC I come here to remember. It's one of the most useful functions in Pandas.

  • @arifchowdhury7089
    @arifchowdhury7089 2 ปีที่แล้ว

    So easy when Corey explains

  • @MrGokTR
    @MrGokTR 4 ปีที่แล้ว +3

    Thanks for sharing such an amazing series. You are basically representing the Zen of Python in person!

  • @ndiayemodou3474
    @ndiayemodou3474 4 ปีที่แล้ว +6

    There is also someone from Senegal west Africa :)
    you are amazing !

  • @pouyarahimpour484
    @pouyarahimpour484 ปีที่แล้ว

    When negated the filt statement (9:19) you should have said 'and' instead of 'or'. Thanks for this great series.

  • @HaoranZhang-jc8fq
    @HaoranZhang-jc8fq 2 หลายเดือนก่อน +1

    Your lectures are so great!!

  • @user-sd2cd2vj1f
    @user-sd2cd2vj1f 2 หลายเดือนก่อน

    Thanks for the 'data filtering' code as it helped in my project.

  • @dmitrishostakovich3156
    @dmitrishostakovich3156 4 ปีที่แล้ว +1

    There's a little mistake at 9:20. The opposite of this conditional has & instead of |. So:
    filt_2 = (df['last'] == "Schafer") | (df["first"] == "John")
    ~filt_2 = (df['last'] == "Schafer") & (df["first"] == "John")
    Still, great videos. I'm very grateful. Please keep it up.

  • @clexyk
    @clexyk 3 ปีที่แล้ว +1

    Corey, your tutorials of Python are the best stuff I have ever seen. The ones on Pandas is again of very high quality.

  • @MANISH12665
    @MANISH12665 2 หลายเดือนก่อน +1

    Hey Corey I have just completed your tutorial on flask i just love the way you taught . I have one request can you please make a tutorial on Python Pyramid framework . I found everywhere but there is no proper tutorial on Pyramid framework on youtube or any other learning platform Can you please make a tutorial on Pyramid framework

  • @junaidmalik9593
    @junaidmalik9593 4 ปีที่แล้ว +2

    your playlist is amazing.
    to be honest i have taken dozens of courses online for python on many platforms but non of those have been completed beyond 20 %. looking forward to gain the skill here at least, as its fun to hear and v understandable

  • @Takk6
    @Takk6 4 ปีที่แล้ว +7

    I rarely comment but I've watched alot of Pandas tutorials on youtube and this is by far the best one Ive seen. Subscribed.
    Will you be doing a Scikit-learn tutorial in the future?

    • @coreyms
      @coreyms  4 ปีที่แล้ว +7

      Thanks! And yes, I will be covering that, but I don’t have a timeframe of when this will be yet.

  • @rishikambhampati2862
    @rishikambhampati2862 4 ปีที่แล้ว +3

    Though we have an idea of the concept, there will always be something new to learn from your videos. As usual thanks a lot.

  • @nikhilgoud9019
    @nikhilgoud9019 3 ปีที่แล้ว

    The true,false series returned from filter it's actually same concept applied in RDBMS Whenever we apply condition only the true values of the rows are printed I really like the way you explain the stuff keep it going and thank you for your valuable content

  • @KeithFlint350
    @KeithFlint350 2 ปีที่แล้ว

    Proper tutorial with a proper English

  • @shamseshifat7825
    @shamseshifat7825 4 ปีที่แล้ว +1

    Your in-depth knowledge in python is astonishing!
    The thing that always amazes me is, when you finish explaining a topic and I ask myself " Now what if I try to do that?" kinda questions and within no seconds I see you explaining the same question! 😳
    Do you mind read your viewers or what? 😅
    Anyways, you are a legend

  • @pythonwala510
    @pythonwala510 4 ปีที่แล้ว +1

    Your video of pandas series is very helpfull for me to underatand python. I like your way of delivering the explanation. I'm eagerly waiting for your next video.

  • @jasonbwaljones
    @jasonbwaljones 2 ปีที่แล้ว

    This is the holy grail series for Pandas in 2021

  • @zahidkamil7833
    @zahidkamil7833 4 ปีที่แล้ว +2

    Can't wait for the string method you said in pandas. I am really looking forward for that. Thank you so much for all your effort and help! :)

  • @thefireagen
    @thefireagen 4 ปีที่แล้ว +1

    So far so good explanation..I have been watching the series since its started...I came again to revise.
    just a quick suggestion from my side...please give a suitable name to filter variable so that it will look readable if someone wants to understand whats happening.

  • @saikiranedits802
    @saikiranedits802 4 ปีที่แล้ว +2

    Very very thankful for your videos.
    ❤ from INDIA

  • @sshbk5878
    @sshbk5878 2 ปีที่แล้ว

    Corey is the best, following you since 2020

  • @kingveelatte41
    @kingveelatte41 3 ปีที่แล้ว

    Found this channel couple weeks ago, and I watch it almost everyday know, like watching fiction series i love. Thank you Corey for amazing video (I forgot if I already comment like this in another video but yeah Thank you as always)

  • @kingkai129
    @kingkai129 4 ปีที่แล้ว +1

    I'm so thankful that I found your channel!!!!

  • @gibranportillo5876
    @gibranportillo5876 4 ปีที่แล้ว +2

    You're the best. thanks so much!! Greetings From Mexico

  • @mosama22
    @mosama22 ปีที่แล้ว +1

    Thank you so much for the beautiful video 😊, would someone please put a link for the truth table Corey mentioned in the video. Thank you 😊😊

  • @vijaybabu3923
    @vijaybabu3923 4 ปีที่แล้ว +1

    Very fluid explanation of Pandas 👌 thanks Corey !

  • @atulkumar7030
    @atulkumar7030 4 ปีที่แล้ว +1

    He is an awesome tutor! Boss really impressed by your videos. Please start with ML based contents soon.

  • @thekitten117
    @thekitten117 4 ปีที่แล้ว +1

    Great vids. You are extremely good at simplifying the topic. I am a noob coming to python from SAS. I would like to see a vid on why python allows you create a field using # df['new'] = df['old1'] + df['old2'] # but does not let you use a function to create a new field in the same way # df['mydate'] = datetime(df['year'], df['month'], df['day']) # After some searching I found how to do it with an anonymous function. If you do a section on creating new fields from others, please cover this task.

  • @lilahinzelbergyifa292
    @lilahinzelbergyifa292 4 ปีที่แล้ว +2

    Corey, this is simply great! Thanks!

  • @Rajesh-nb9de
    @Rajesh-nb9de 3 ปีที่แล้ว

    This is the best library to learn pandas... love from india

  • @Troyjl_3
    @Troyjl_3 2 ปีที่แล้ว

    Your page is helping me so much in my new engineering position
    Thank you and I would love to ask you questions!?

  • @libertarianmonk7013
    @libertarianmonk7013 ปีที่แล้ว

    Thank you very much!
    The last command was the one I was looking for 😊

  • @crazybigworld9357
    @crazybigworld9357 2 ปีที่แล้ว

    Thank you Corey. You're one of my best Python Teachers.

  • @rudiklein
    @rudiklein 4 ปีที่แล้ว +2

    What can I say...great job with this series. Again.

  • @auroshisray9140
    @auroshisray9140 4 ปีที่แล้ว

    Your tutorials are well structured and easy to understand. Thank you so much

  • @AbrahamWilson
    @AbrahamWilson 4 ปีที่แล้ว +3

    Hey Corey, I have a request, could you make a tutorial explaining how to make async django applications. The topics seems quiet confusing, your way of explaining things makes them feels more simple.

  • @bjorncalbes7604
    @bjorncalbes7604 2 ปีที่แล้ว

    these videos are gold very helpful i was lucky enough to find your channel and really help me better understand python
    i have a question, after applying the filter it shows the index. and the email, how can you just get the email string so you can assign it to another string or use it?

  • @SotovisionHD
    @SotovisionHD 4 ปีที่แล้ว +1

    THANKS! finally I get the filtering from pandas.

  • @eduardolima5495
    @eduardolima5495 3 ปีที่แล้ว

    Really, I'm so thankful for this series!! I really really appreciate your effort to make those videos and teach me something new!

  • @sebastianmuller1210
    @sebastianmuller1210 4 ปีที่แล้ว +1

    I like your videos. I want to suggest another "pandas" topic: Making Pivot Tabeles. Yes its a Matplotlib thing, but when i change from excel to pandas and want to do "all the tipical stuff", i won't look for a Matplotlib Tutorial. So you can introduce that skill in the Pandas Series as well.

  • @hameem6845
    @hameem6845 4 ปีที่แล้ว +4

    Just came to like. Will watch later.

  • @roywilson9580
    @roywilson9580 4 ปีที่แล้ว +1

    Thanks, Corey for uploading this interesting, useful and educational video. It was a great help in understanding the process of filtering data in Pandas. Will be really useful to me.

  • @mazensleiman3863
    @mazensleiman3863 3 ปีที่แล้ว

    a big fat thank you Corey, that is one amazing video. and I will definitely watch the whole series

  • @Fantasy7117
    @Fantasy7117 10 หลายเดือนก่อน

    I'm loving your lessons😊 thank you

  • @alejandropaloalto538
    @alejandropaloalto538 2 ปีที่แล้ว

    Thanks Corey, I see you from Mexico

  • @dataguy3553
    @dataguy3553 2 ปีที่แล้ว

    thank you so much Corey for this Pandas playlist, I love them, they are super helpful.

  • @anuragshukla7813
    @anuragshukla7813 4 ปีที่แล้ว +1

    Thank you so much for posting the high quality and so knowledgeable video on youtube. And this is the best channel ever channel on youtube I have seen. You are doing great work keep it up, brother.
    Thank you again for these type videos, Please keep on posting these type of video in the future also.

  • @jessicasanger7194
    @jessicasanger7194 4 ปีที่แล้ว +1

    Thank you!!! ☺️
    This came just in time for me. I tried filtering the data by adding a series of True and False values as a column to the data frame😂

  • @sartajsingh8459
    @sartajsingh8459 2 ปีที่แล้ว

    Thank you so much for making these videos. They are really helpful to me in learning ML and AI

  • @eltorayy11
    @eltorayy11 3 ปีที่แล้ว

    I really like the way you explained! Thank you so much

  • @dipanjan93
    @dipanjan93 3 ปีที่แล้ว +2

    @Corey Many thanks for posting your tutorials mate. These are super helpful getting started with Pandas. I have a doubt @6:03, you mentioned that you prefer to use df.loc[filt, 'email'] for filtering over a specific column, however I was able to achieve the same with df[filt].email as well ? Do you mind explaining this. Thanks. Cheers!

  • @DendrocnideMoroides
    @DendrocnideMoroides 2 ปีที่แล้ว +1

    Pro tip: in Jupyter if you ever want to see all the shortcuts the press H key (The shortcuts are very useful)

  • @claudiocl8937
    @claudiocl8937 8 หลายเดือนก่อน

    That str.contains() is going to be fun when you try looking for java programmers and get all the javascript ones too

  • @jorginh05
    @jorginh05 2 ปีที่แล้ว

    You saved my life!!!
    thank you for the content

  • @muntadher8087
    @muntadher8087 2 ปีที่แล้ว

    Thank you Corey!!
    Amazing video

  • @prmurali1leo
    @prmurali1leo 3 ปีที่แล้ว

    This is awesome, Coreys in the best tutor ever i have experienced

  • @rafdnaah6078
    @rafdnaah6078 4 ปีที่แล้ว

    Thanks for the excellent videos. I'm upgrading my database skills to data engineering and your channel is an excellent source of knowledge and skills building. I have one suggestion though; I'd appreciate if you do not overwrite previous statements in the same cell. Always start in a new cell, even if it is a trivial modification of the previous statement. Thanks

  • @abanerjee3704
    @abanerjee3704 3 ปีที่แล้ว

    That was the best quality content on Pandas. Keep it up brother.
    ALL THE BEST.

  • @danielflorea3001
    @danielflorea3001 2 ปีที่แล้ว

    Really a pragmatic video on Pandas. Great work

  • @SuperBhavanishankar
    @SuperBhavanishankar ปีที่แล้ว

    15:34 this SAVED MY INTERVIEW! 😗😗😗😗

  • @supriya1316
    @supriya1316 2 ปีที่แล้ว

    Great. I am really happy learning from your channel. You explain the concepts with so much clarity . Thanks a ton . Could you please also suggest some of the resources for practicing all the concepts learnt so far .

  • @kailashks901
    @kailashks901 3 ปีที่แล้ว

    You missed the chance to say.. It was brilliant of Brilliant to sponsor this video..
    I will show myself out.

  • @mikshubhatt1175
    @mikshubhatt1175 3 ปีที่แล้ว

    i appreciate your work. you are putting some serious efforts in your videos.