ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Python Pandas Tutorial (Part 2): DataFrame and Series Basics - Selecting Rows and Columns

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ส.ค. 2024
  • In this video, we will be learning about the Pandas DataFrame and Series objects.
    This video is sponsored by Brilliant. Go to brilliant.org/cms to sign up for free. Be one of the first 200 people to sign up with this link and get 20% off your premium subscription.
    In this Python Programming video, we will be learning about the DataFrame and Series objects. These are the backbone of Pandas and are fundamental to the library. DataFrames can be thought of as rows and columns, while a Series can be thought of as just a single column of rows. We'll also learn the basic navigation of these datatypes by learning how to select specific rows and columns. Let's get started...
    The code for this video can be found at:
    bit.ly/Pandas-02
    StackOverflow Survey Download Page - bit.ly/SO-Surve...
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com...
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer
    #Python #Pandas

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

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

    I hope everyone finds this helpful! I will be releasing the 3rd video of the series on Monday. The next video will be on indexes. Indexes are very useful once we get the hang of them, so be sure to check that out. I hope everyone has a great weekend!
    I'd like to thank Brilliant for sponsoring this series. If you'd like to check them out then you can sign up with this link and get 20% off your premium subscription:
    brilliant.org/cms

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

      You're a very good teacher, wish you had more time to do all the packages/libraries lmao.

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

      Love your lectures. Can't wait for the 3rd video! Thank you so much.

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

      Even when I'm not that interest in the content, I still watch your videos and learn something new.
      Looking for the day when you're teaching about async code. Like, real deep on "what is happening and how".

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

      @Soya Ashida He uses Sublime Text. In this video he walks through the set up th-cam.com/video/xFciV6Ew5r4/w-d-xo.html

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

      Hi Corey, thankyou so much for your hard work and wonderful videos. I want to learn Machine Learning but I am confused from where to start and what I need to learn. Can you please make videos on machine learning as well. I don't want to watch other videos because you are the best. hoping for a reply. Thanks

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

    I keep the ads running because you earn it!

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

    i really like the way you present information...many others just squeeze everything into one unorganized video, but you really take your time to explain every step in plain understandable english so everyone can follow...i think many teachers can learn from your way of presenting!
    I really want to thank you for creating such beautiful content!

    • @ShawnDypxz
      @ShawnDypxz 3 ปีที่แล้ว +5

      He is a superstar. I wish he had made videos on Numpy as well.

  • @xluyyjhfg
    @xluyyjhfg 3 ปีที่แล้ว +143

    8:23 - access a single column via string()
    11:25 - dot notation
    13:31 - access multiple COLUMNS- pass in a list() of the columns you want.
    15:23 - list all the columns - df.columns
    14:40 - access ROWS with loc and iloc -- loc is for labels, iloc is for integers.
    20:49 - use two lists, one for the ROWS and another, second list, for COLUMNS to get a subset of the DataFrame.

  • @rhys87
    @rhys87 3 ปีที่แล้ว +33

    Not only does he explains things well, I think he was trained/taught well because you can see that he does most things the most simple and efficient way most of the time. Really helps to understand the basics without a lot of noise around to confuse at the start. Best teacher I have come across in teaching Python.

  • @balogunanuoluwapo7281
    @balogunanuoluwapo7281 ปีที่แล้ว +16

    I'm a Nigerian and an aspiring data scientist. Your video has really helped me understand better the basics of pandas . I just want to say thank you too. And you'd surely be a part of my success story when I eventually pull through. Cos I still have a lot to learn really . But this basics and working with real life projects is very very encouraging

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

      Hello Aanu, I would like to connect with you and rub mind together. I'm an aspiring data scientist too

  • @rizwan1220
    @rizwan1220 3 ปีที่แล้ว +9

    You are the best teacher that i have ever seen. Even our uni professors failed to teach like you. hats off to you

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

    You literally made a series of videos covering my whole exam. So grateful to having these.

  • @sharmakartikeya
    @sharmakartikeya 3 ปีที่แล้ว +15

    Hands down the best dedicated pandas tutorial on TH-cam for me. I like knowing most of the things before jumping in so this is like the Holy Grail for me for Pandas

  • @ZahidHasan-cc8tf
    @ZahidHasan-cc8tf 3 ปีที่แล้ว +3

    Seriously!! This is one of its kind tutorials that I enjoy following and learning from. I actually wish that the video doesn't end. You don't teach us just basic stuff but gradually from beginning to advanced in such a subtle way that even a beginner like me can follow without any difficulty.

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

    Beautiful work youre doing there mate!! Did mention how i am enrolled in few courses for the understanding of data analysis , but as soon as i came across your tutorials i knew i that i wont be searching no more. Brilliant hands on approach to data analysis with pandas

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

    Far better than all the paid courses, the best content I ever found on web

  • @valerioharvey7289
    @valerioharvey7289 21 วันที่ผ่านมา +1

    Thank you very much! This is the only course where i understand completely about how this library works.

  • @180_gram_vinyl
    @180_gram_vinyl 4 ปีที่แล้ว +29

    Great video, Corey. Another reason to use bracket notation instead of dot notation to access columns is in case you have column names that contain spaces. Dot notation won’t work if that is the case, so as you recommended, it’s just easier to use bracket notation because it’s less to worry about.

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

      Great point! Forgot to mention that. Thanks!

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

      The advantage of dot notation is that it's more convenient. When you clean your data and do some initial explorations and transformations, you do a lot of column selections and dot notation can quickly become a nuisance. If your columns have names that might give you errors, it's faster to rename them and use dot notation than it is to use bracket notation. At least, that's how I feel about it. 😊

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

      This is a good reason. I think conflicts between column name and method is not right because methods have parentheses.

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

    One clarification here, if you do slicing using iloc, the end index is not inclusive, that is, if you run a command df.iloc[0:2, 1], this would return only the first 2 rows (works just like core Python). Whereas in case of loc, it returns the end index (returns all 3 rows for above example), which is very well explained by Corey.

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

    just know it bro you are legend for people like us !! i have seen lots of tutorials videos but no one is close you ...God bless you with everything !!

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

    This series is no doubt gonna be the best series for 🐼
    Just can't wait for more videos

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

    Thank you so much for the tutorial its probably the best tutorial available in You tube for pandas .I am not skipping any ads played during the lecture .

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

    I really dont understand why you have less subscribers. Your content and knowledge is outstanding I really love your tutorials. I have learnt many things from your channel 🔥🔥

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

    Pandas makes data analysis easy and Corey makes pandas easy!

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

    This approach with the rows and columns is pure genius!

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

    I never skip an ad as my way of saying thank you 😁

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

      Your devotion has been recorded -
      btw, do you happen to know any useful machine learning resources like these video tutorials?

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

      @@KshitijKale Andrew Yang's course is pretty good. th-cam.com/video/PPLop4L2eGk/w-d-xo.html

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

      @@vatsalgupta00 honestly thought it was the former candidate.

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

    The best channel for python in TH-cam by far ... love your videos!

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

    Corey Schafer, you are the best and I've learnt Python from scratch just by following your lectures.
    Thank you for the lectures.

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

    I am so glad you are uploading the pandas series so frequently. Thankyou very much and keep up the good work.

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

    Been watching your videos for years man. Finally got my first Python job. Can’t thank you enough. Knocking out this series this week :)

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

    Thanks a lot for this series! This the most complete and easy to understand python tutorial i have seen. Great work!

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

    This series of videos about pandas are very well written. Thank you for the quality of your contents, I am super happy to learn to use pandas and Python with you :)

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

      I feel like I now have the literacy to understand other online resources.

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

    Even after 4 years past, this series is just perfect...Thanks for it.

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

    İ bought sone courses on udemy. but your courses so much better !! i am happy that finally i found a place where i can learn the programming decently

  • @AllRounder-km3lh
    @AllRounder-km3lh 2 ปีที่แล้ว

    I visit every ad playing on your video so u will get more $. U deserve it.

  • @SumitGupta-ys7lb
    @SumitGupta-ys7lb 5 หลายเดือนก่อน +2

    One of the best starters, just pulled me into pandas :)

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

    Thank you for the video. I am grateful for your time and contribution. Kind regards, Akira.

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

    Part 1: Using a Dictionary
    3:05 What is a DataFrame
    3:32 Using Dictionary to store information
    6:57 Create a DataFrame from Dictionary
    8:22 Access a single column using brackets
    13:29 Access multiple columns using brackets
    15:59 Access a single row using iloc
    17:11 Access multiple rows using iloc
    17:50 Access columns and rows using iloc
    19:45 Access a single row using loc
    20:08 Access multiple rows using loc
    20:44 Access columns and rows using loc
    Part 2: Using a Dataset
    23:05 See how many rows and columns
    23:05 See all columns name
    25:17 Count unique values
    28:48 Using slicing

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

    one of the best teachers on the web! just needs to include more documentation in his videos

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

    I have basic understanding of pandas, sometimes I am reluctant to forwarding video because every word coming out of you is useful❤

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

    by far the best series about pandas

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

    perfect
    watching your videos is the best experience I've ever had, brilliant. tnx to make python easy to learn

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

    Thank you so much for this series. I am looking to convert a huge excel workbook with various calculations to a python script and it involves a lot of data processing. I am exploring pandas and this series has been really helpful so far.

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

    Thank you. The amount of content with no breaks and medium-slow speaking speed as well as the illustration helped. I was about to make plots thinking no one had published a good explanation of the difference between dataframe and series in an easy-to-understand example. I like how we started off with, why not use Python dictionaries with lists? to get to pandas dataframe.

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

    Thank you so much Corey Schafer, your teaching series are definitely going to help mould me into the developer I wanna become

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

    You are a terrific teacher, can't wait to watch your other videos. Thank you!

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

    I was really stuck with the selecting rows and columns... but now I have a better understanding. Great video!

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

    Thank you, Corey Schafer. your videos are so easy to understand and helping me to learn Pandas

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

    I thought this tutorial was excellent.
    Despite having prior Knowledge but the video is just so awesome.
    Thanks for sharing the good work.

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

    Could you please make a complete playlist on machine learning with Python ? We would love to watch it .

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

    As an aside, this is probably one of the most interesting topics to make a video series on with python. I'm imagining all the unbelievable things we can learn using this increedible tool. Please keep this series running, I'd love to see you do some really interesting experiments with this data, or some interesting data period.

  • @user-fq2nd8nw6f
    @user-fq2nd8nw6f 4 ปีที่แล้ว

    I will merely heap praise on an already mountainous pile. You are the best out there. By a very long stretch.

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

    Hey Corey! I just wanna say "THANK YOU" cause your tutorials have helped in understanding python and learning important libraries!! Keep doing the good work!! You explain complex things so simply...... I love it. Thanks again for all your help!!

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

    The best explanation ever for complete beginner like me, big thanks to you, siR

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

    DataFrame looks similar to views in SQL Databases. You get a small portion of the whole data as needed and manipulate that. Great tutorial as usual Corey!

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

    best video series. i started yesterday. And am planning to continue all the 11 videos. thanks a lot. this freee course means a lot to me. thanks..

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

    i don't know if it's a bug or it's intentional (certainly it's confusing), but df.iloc[0:2] will return you rows 0 and 1 but not 2, whereas df.loc[0:2] will return you rows 0, 1 and 2.
    edit. oh, i get it now. when i use df.iloc[0:2] i'm working on integers 0, 1 and 2 and therefore python logic of inclusive:exclusive applies. however when i'm using df.loc[0:2] i'm working on labels '0,' '1' and '2' and therefore language logic of inclusive:inclusive applies, as in "I'm working from Monday to Friday." means that i'm working on Friday as well.

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

    The quick taste to the power of pandas was delicious.

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

    Corey you are the GOAT when it comes to python tutorials. love your work!

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

    Thank you Brilliant for sponsoring such great educational videos from Corey!

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

    Thank you for explaining python in easy words. Your lectures are very well scripted and provide very good information. Thanks for your hard work!

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

    Amazing ! He never squeezes the concepts , Beautiful explaination !

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

    Thank you so much Corey!!
    As always well structured with relevant examples.
    Keep up the good work. ☺️

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

    If teaching is an art , Corey is the pikaso

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

    Excellent tutorial Corey as usual. - Many thanks

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

    You have great teaching style . Concise and clear thank you.

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

    I learned more about .loc[ ] than ever before. Thank you good sir!

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

    I can't believe I just watched this for free. Great job!

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

    Excellent job. Congrats!

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

    you are a talented teacher Corey, keep it up! I will always support your channel in anyway possible. Thanks!

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

    oh my god I am gonna cry now... your video really helped me a lot !!!!!

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

    hey Corey, I cannot resist to say thank you for this video. This solved many of my presious ambiguous understanding of Pandas. Very helpful!!

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

    Great video, really easy to listen to and has a great format. I look forward to the rest of these.

  • @md.niazulislamroky4144
    @md.niazulislamroky4144 7 หลายเดือนก่อน

    this is the most satisfying pandas playlist!

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

    super clear, thank you!

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

    perfect pandas tutorial ever in youtube and even on internet

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

    Great stuff, Corey. Very clear. Thanks

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

    thank you for these lessons Corey!

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

    Beginning with the dictionary of list, 👌 spot on helps.

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

    Very cool explanation 👍
    I have noticed something by the way :) , whenever I use a list inside the brackets for multiple values or even a single value (either acquiring columns or rows), it gives us the output as a data frame, but when we do it directly for a single value without using list brackets (square brackets), it gives us the information in a different way, just like a description output or something which is called a series data type as you explained!!

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

    whole videos in this series are incredible! you are awesome

  • @najobsodar7528
    @najobsodar7528 4 หลายเดือนก่อน +1

    Well explained!, many thanks

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

    Thanks man, your tutorials are really helpful and I can confidently rely on them to get myself upskilled and find a job in the market. Thanks a lot!

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

    best python training on universe

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

    I signed up for Brilliant and cancelled my LinkedIn Learning. Love your videos Corey, thank you!

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

    Hey Corey! Just wanted to appreciate your efforts and talent man! You are catering to educating thousands out there and this is education in the truest sense. Keep up the good work!
    P.S- Also if you could do a series on Machine Learning, Neural Networks, Deep Leaning

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

    Thanks Corey! This video is really useful, especially for someone learning python and Pandas for specific project.

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

    Your knowledge is 3 years old and still hitting very hard a lot of online teaching platforms

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

    Brother, thank you for all the videos.

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

    Struggling to find one good pandas tutorial tries some other good also but this one is the best

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

    Excellent tutorial Corey!

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

    You are the best teacher Corey !! Thank you for doing this for community !

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

    Thank you so much Corey, really clear and very easy to learn. Subscribed.

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

    Krish naik recommended your channel and you are aawesssommmeeeee

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

    Thank you. can you also do a series on GUI perhaps with Qt.

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

    This is very helpful. Thanking for your tutorials.

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

    Hi Corey,
    You have done a wonderful job on all these videos.
    Can you do few videos on machine learning, deep learning, NLP and neural network please.

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

    Really Helpful Series both as a refresher and for a beginner.

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

    Top python video. Straight forward, no bullshit

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

    Thank you thank you thank you soooooo much!!!!! This was so helpful!!!! You're a blessing!!! :)

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

    I see new Corey video, i press like.
    Now lets see how can i simplify my life even more.

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

    de best for beginner ever

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

    How are you so good at organizing the information in your videos?? 😮

  • @Diego-Desde-Argentina
    @Diego-Desde-Argentina 7 หลายเดือนก่อน

    Thank you, very organized and well explained! Keep the great work!