Тёмный

How do I select multiple rows and columns from a pandas DataFrame? 

Data School
Подписаться 241 тыс.
Просмотров 349 тыс.
50% 1

Have you ever been confused about the "right" way to select rows and columns from a DataFrame? pandas gives you an incredible number of options for doing so, but in this video, I'll outline the current best practices for row and column selection using the loc, iloc, and ix methods.
SUBSCRIBE to learn data science with Python:
ru-vid.com?su...
JOIN the "Data School Insiders" community and receive exclusive rewards:
/ dataschool
== RESOURCES ==
GitHub repository for the series: github.com/justmarkham/pandas...
"loc" documentation: pandas.pydata.org/pandas-docs/...
"iloc" documentation: pandas.pydata.org/pandas-docs/...
"ix" documentation: pandas.pydata.org/pandas-docs/...
Summary of the pandas API for selection: github.com/pydata/pandas/issu...
== LET'S CONNECT! ==
Newsletter: www.dataschool.io/subscribe/
Twitter: / justmarkham
Facebook: / datascienceschool
LinkedIn: / justmarkham

Опубликовано:

 

6 июн 2016

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 811   
@dataschool
@dataschool 6 лет назад
As of pandas 0.20 (released May 2017), ix has officially been deprecated. Watch my new video, "5 new changes in pandas you need to know about", if you want to learn how to duplicate the functionality of ix using loc and iloc: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-te5JrSCW-LY.html
@averyhr
@averyhr 5 лет назад
Data School c
@lenac3587
@lenac3587 4 года назад
Meh, lessons learned today. Should read comment first before sitting through the last confusing part on ix concept. Thanks for the tip that it's deprecated.
@DelandaBaudLacanian
@DelandaBaudLacanian 4 года назад
thanks for the update, you're the best!
@Friends.shorts
@Friends.shorts 4 года назад
thanks for update.
@anokhikumari6900
@anokhikumari6900 4 года назад
you are genious
@elpintor2091
@elpintor2091 5 лет назад
I love how he teaches, slow, thorough, easy to understand and with plenty of examples
@dataschool
@dataschool 5 лет назад
Thanks so much for your kind comment!
@ankurgupta7102
@ankurgupta7102 3 года назад
I watch it with 1.75 speed and still understandable
@mabelleth
@mabelleth 3 года назад
Still applies today! I love it!
@igorballesteros6012
@igorballesteros6012 5 лет назад
Your voice tone is perfect for learning. Great video!
@dataschool
@dataschool 5 лет назад
Thanks! :)
@mawkuri5496
@mawkuri5496 2 года назад
he sounds like nile red
@svin30535
@svin30535 8 лет назад
Congratulations on your marriage! Thanks for making awesome data school videos, I learned and refreshed lots of my Python skills here.
@dataschool
@dataschool 8 лет назад
Thanks for your kind words! :)
@genet480
@genet480 4 года назад
I really like all your video tutorials.You explain things in a very methodological sequence with high clarity and gentle approach which is vital for beginner data science learners. We are very fortunate to have a free access to such high-quality educational resource. You are one of my favorite you-tube instructors I have ever watched. Thank you one thousand times!!!
@michaelbachman5038
@michaelbachman5038 7 лет назад
Your explanations are clear and comprehensive. Glad I found your channel. Look forward to viewing more of your videos. Thank you!
@dataschool
@dataschool 7 лет назад
Thanks so much for your kind comment!
@michellelee7585
@michellelee7585 4 года назад
Just discovered this channel and I'm already eager to explore more! Thanks for breaking things down so simply and with tons of useful examples. I especially love it when you highlight to us efficient vs non-efficient / bug-prone codes.
@dataschool
@dataschool 4 года назад
Great to hear!
@prodigyswifeybaby
@prodigyswifeybaby 7 лет назад
Your pace is excellent! I like how you show the different options and recommendations. Keep up the good work!
@dataschool
@dataschool 7 лет назад
Thanks so much! I'm glad the pace and style of my videos is helpful to you!
@TheHoinoel
@TheHoinoel 5 лет назад
you are a godsend! Thank you so much for these tutorials. I knew it couldn't be as complicated as other people always made it out to be! Much love
@dataschool
@dataschool 5 лет назад
You're very welcome! Glad it was helpful to you :)
@AlexanderArtamonov
@AlexanderArtamonov 4 года назад
After a few days of reading pandas documentation and numerous 'tutorials' I finally get a general principle of how loc/iloc works, thank you!
@mandyma7243
@mandyma7243 3 года назад
Thank you for being patient and really informative!
@anastasiyan44
@anastasiyan44 4 года назад
the best explanation I've come across, and it actually applies to all your videos. Thank you!
@pressiyamu2187
@pressiyamu2187 4 года назад
Dude this was like the one function that I couldn't comprehend. Thanks a ton!
@TomSkinner
@TomSkinner 7 лет назад
Just wanted to pile on the accolades, thanks. Perfectly paced, clear, succinct. It was just what I needed.
@dataschool
@dataschool 7 лет назад
Great to hear! Thanks so much for your kind comment.
@vman049
@vman049 4 года назад
Have watched this videos to refresh myself on two separate occasions. Very clear and concise with excellent examples. Thank you!
@dataschool
@dataschool 4 года назад
Thanks for your kind words!
@ChiefKamek
@ChiefKamek 7 лет назад
I'd like to thank you for this series! You are a fantastic teacher: the videos are clear and of good quality, you go over everything in a relaxed way and explain everything thorougly. This series is helping me out a lot, great work!
@dataschool
@dataschool 7 лет назад
Wow, thank you so much for your incredibly kind comment! It's really great to hear that the series is useful to you!
@PatrickBateman12420
@PatrickBateman12420 6 лет назад
Wow, best explanation on iloc/loc I have ever seen !!! Thank you for sharing!!!
@dataschool
@dataschool 6 лет назад
Thanks so much! I worked very hard on that video :)
@RufusVidS
@RufusVidS 6 лет назад
I dropped into this video from another video and am so happy it happened! You have a very clear voice in the video, you clearly know your stuff, you give plenty of good examples of good practice and practices to avoid, and are quite thorough. I enjoyed this one very much and plan to check the others out right away. Also, congrats on your marriage, I hope you are still happily together now that a couple years have passed!
@dataschool
@dataschool 6 лет назад
Thanks so much for your incredibly kind words! I very much appreciate it! And yes, we are still married :)
@suhanasharma2965
@suhanasharma2965 4 года назад
your way of teaching is too good sir.thanks a lot
@chelseali4463
@chelseali4463 4 года назад
Your explanations have been one the of best I have found so far on dataframes!
@dataschool
@dataschool 4 года назад
Thanks very much for your kind words!
@MK-xm2nh
@MK-xm2nh Год назад
Your tutorials are very useful, and contain a good number of use cases for the duration. Thank you!
@dataschool
@dataschool Год назад
Glad it was helpful!
@ziaw123
@ziaw123 3 года назад
Hi, this is the best explanation ever!!! Super clear and you teach it slowly and show us different ways of doing and also why we should/should not use certain methods. This is so helpful!!! Thank you so much!!!
@dataschool
@dataschool 2 года назад
You're very welcome! 😄
@zackhicks2433
@zackhicks2433 5 лет назад
Thanks for these videos - hands down the best videos online for learning how to data science.
@dataschool
@dataschool 5 лет назад
Thank you so much for your very kind comment!
@sanaullahkhanhassanzai8432
@sanaullahkhanhassanzai8432 5 лет назад
You are one of the best on you tube and the best on Pandas without a doubt, Keep up the good work. Thank you so much for the videos
@dataschool
@dataschool 5 лет назад
Thanks so much!
@JonathanDewetfunlifegod
@JonathanDewetfunlifegod 6 лет назад
Great video. Your voice is very clear even when sped up and you explained the concepts very well. Thank you.
@dataschool
@dataschool 6 лет назад
You're very welcome!
@harijayaram
@harijayaram 7 лет назад
you are a very good teacher ...thanks again...i'm always using loc from now on
@dataschool
@dataschool 7 лет назад
Thanks for your kind words!
@rinmulder2008
@rinmulder2008 3 года назад
The pace and tone is excellent. Thanks for making the simple things clear. I am a subscriber now
@dataschool
@dataschool 2 года назад
Thank you! 🙏
@michaelakatwijuka3465
@michaelakatwijuka3465 6 лет назад
I really have not found explanations as clear as this.Thank you Steven
@dataschool
@dataschool 6 лет назад
Glad it was helpful to you!
@RaynerGS
@RaynerGS 6 лет назад
Good job, thanks! Keep on speaking high and clean as like in this video, this way facilitates so much for who is no English spoken native.
@dataschool
@dataschool 6 лет назад
I'm glad to hear that my teaching style works for you! Really appreciate your comment :)
@TheFallibleFiend
@TheFallibleFiend 5 лет назад
I've watched this video several times and followed through with the exercise. But I just used iloc at work for the first time. Very handy.
@dataschool
@dataschool 5 лет назад
Great to hear!
@irakliberidze156
@irakliberidze156 3 года назад
Big thanks for your job!!! Do not stop. too many people need video tutorials like this. waiting your new videos.
@dataschool
@dataschool 3 года назад
More to come soon!
@rgseven6557
@rgseven6557 2 года назад
Honestly, this is one of the best videos regarding panda data frames and column selection. Your explanation is to the point yet easy to comprehend. I sincerely thank you for taking the time to create this lesson. Its times like this where I consider myself so fortunate to have access to the internet. Subscribed!
@dataschool
@dataschool 2 года назад
You are so very welcome!
@nicholasroman8071
@nicholasroman8071 3 года назад
Very nice systematic break down of how to drill into a dataFrame. It was worth my time to watch this video.
@dataschool
@dataschool 2 года назад
Great to hear!
@harrykaranikas7741
@harrykaranikas7741 3 года назад
Still... The best videos for Pandas on RU-vid! Thank you!
@dataschool
@dataschool 2 года назад
Thank you!
@220piyush
@220piyush 3 года назад
Thank You for this!!! I had so confusions regarding this topic and looking for a such a clear and informative video.
@dataschool
@dataschool 3 года назад
Glad it was helpful!
@rajsx5
@rajsx5 7 лет назад
Congratulations on your Marriage!! And thanks for creating so neat and informative videos, learned a lot, I really appreciate it. Thanks again!
@dataschool
@dataschool 7 лет назад
Thanks so much for your kind words and your well wishes! :)
@mohamedel-gazzar5818
@mohamedel-gazzar5818 3 года назад
legend absolute legend. I have been recently doing a course on data analysis and I keep coming back to this man's videos for help.
@dataschool
@dataschool 2 года назад
🙌
@balford2112
@balford2112 Год назад
Thank you so much for this video. Very easy to understand and comprehensive.
@dataschool
@dataschool Год назад
Glad it was helpful!
@jaydock1
@jaydock1 2 года назад
this is the most clear version of this I've found! great stuff
@dataschool
@dataschool 2 года назад
Thank you!
@Gloryisfood
@Gloryisfood 3 года назад
Most useful tutorial I've seen so far. Brilliant!
@dataschool
@dataschool 2 года назад
Wow, thanks!
@PawanBathe
@PawanBathe 4 года назад
Awesome buddy, I watched it 2x still was able to follow along , because I had some familiarity around the concept , but others are also praising you for slow explanation, that's unique, suits for both, thanks for clarity of audio. very concise and clear.
@dataschool
@dataschool 4 года назад
Thanks for your kind words!
@ahe970
@ahe970 Год назад
Really great - though 4 years old video. Just learning Python and found u to be a great teacher. I will look for ur other videos Thanks
@dataschool
@dataschool Год назад
Glad it was helpful!
@diegomedinaflores3362
@diegomedinaflores3362 4 года назад
I found your video because I got this Warning: SettingWithCopyWarning: And you helped me to fix that issue. Thanks you a lot from Perú.
@Seanog1231
@Seanog1231 7 лет назад
Thank you for the great instruction and welcome to the club!
@dataschool
@dataschool 7 лет назад
You're welcome!
@sumanhalder1539
@sumanhalder1539 4 года назад
Excellent explanation: was perplexed by various indexing protocols previously. Great pace and explanation was really helpful.
@dataschool
@dataschool 4 года назад
Great to hear!
@harrwoodhouse2435
@harrwoodhouse2435 3 года назад
Thank you so much, I've been stuck on this issue for ages!
@dataschool
@dataschool 3 года назад
You're very welcome!
@rutviktidke07
@rutviktidke07 3 года назад
Best channel for learning python... kudos to you 👏
@dataschool
@dataschool 3 года назад
Thank you!
@uh6537
@uh6537 3 года назад
I have stuggled a bit with loc and iloc but after 12 min here everything just became clear. Thanks for an awesome explanation of this topic.
@dataschool
@dataschool 3 года назад
You're very welcome!
@noo-sho8500
@noo-sho8500 4 года назад
I think you're the best data science python tutor I had seen :D
@dataschool
@dataschool 4 года назад
Thank you!
@AZ993k
@AZ993k Год назад
Thank you! That's just what I've looked for, in brief
@dataschool
@dataschool Год назад
Glad it was helpful!
@georgesmith3022
@georgesmith3022 5 лет назад
great explanation, perfect voice tone and pace
@dataschool
@dataschool 5 лет назад
Thanks George!
@altunbikubra
@altunbikubra 5 лет назад
Thank you so much for the differentiation. I have taken an e-learning which now I realize that they did not even mention fatal functions of these usages. Now I can run my code, thank you !!!
@dataschool
@dataschool 5 лет назад
You're welcome!
@poonamsachdeva9172
@poonamsachdeva9172 6 лет назад
Excellent video, very clear and practical description. I will watch your other videos on Python and Pandas as well. Thanks a lot.
@dataschool
@dataschool 6 лет назад
Thanks for your kind words!
@louisthiebaud9999
@louisthiebaud9999 3 года назад
Remarquable et très pédagogique! Félicitations pour la qualité de votre prononciation. Thanks a lot!
@dataschool
@dataschool 2 года назад
You're very welcome!
@dean8147
@dean8147 4 года назад
Amazing video. Been a few years since i last had any work related to Python.
@dataschool
@dataschool 4 года назад
Thank you!
@kapilag
@kapilag 6 лет назад
Very clear and sound explanation. Thanks a lot Kevin!!
@dataschool
@dataschool 6 лет назад
You're very welcome!
@Mufc_maddy
@Mufc_maddy 4 года назад
Very nice video, Clearly understand the loc, iloc concept.
@dataschool
@dataschool 4 года назад
Great!
@jerx4959
@jerx4959 2 года назад
I know these vids are older, but thank you. You are an excellent teacher!
@dataschool
@dataschool 2 года назад
Thank you!
@scottlucas3710
@scottlucas3710 7 лет назад
SUPER CLEAR TUTORIALS. NICE JOB
@dataschool
@dataschool 7 лет назад
THANKS!
@yasermahfouz6263
@yasermahfouz6263 3 года назад
your lectures and your examples are very nice , thank you
@dataschool
@dataschool 3 года назад
Thanks!
@archana0404
@archana0404 6 лет назад
Each video is nicely explained. Well done. Thankyou somuch for sharing these video.
@dataschool
@dataschool 6 лет назад
You're very welcome!
@ragavsathis
@ragavsathis 6 лет назад
Thanks for detailed explanation, able to solve my problem and understand in detail about loc
@dataschool
@dataschool 6 лет назад
Great to hear!
@aabedkashwa9125
@aabedkashwa9125 6 лет назад
i swear to god, i love you and your talent in teaching .. you are an awesome teacher, sir this helped me alot, God Bless you.
@dataschool
@dataschool 6 лет назад
Thank you so much! I'm so glad to be of help to you!
@haisonduong4726
@haisonduong4726 7 лет назад
Your videos help me save a lot of money! Thanks!
@dataschool
@dataschool 7 лет назад
Great to hear! :)
@DelandaBaudLacanian
@DelandaBaudLacanian 4 года назад
12:21 nice summary of loc() vs iloc(), lots of good information
@dataschool
@dataschool 4 года назад
Thanks!
@gergstrMoz
@gergstrMoz 4 года назад
I'm only 4 minutes in and already, thank you thank you thank you!!!
@Diachron
@Diachron 7 лет назад
Another winner of a video that cuts through the fog usually surrounding these methods. And congrats on the wedding.
@dataschool
@dataschool 7 лет назад
Thanks very much! :)
@dhanushanthpushparajah1878
@dhanushanthpushparajah1878 7 лет назад
This videos are awesome. Simple and clear. Thanks a lot brother.
@dataschool
@dataschool 7 лет назад
Thanks so much for your kind words!
@Taran72
@Taran72 4 года назад
Great Video! Ideal for a beginner like me. you explain everything in detail and straight to the point.
@dataschool
@dataschool 4 года назад
Thank you!
@petertao287
@petertao287 3 года назад
Good!
@amarn22
@amarn22 7 лет назад
Brilliant. You are a star. You must do more videos in python machine learning and NLP
@winstonloke2860
@winstonloke2860 5 лет назад
Clear and concise, well done!
@dataschool
@dataschool 5 лет назад
Thanks!
@niceday2015
@niceday2015 2 года назад
Thank you very much, I like your video very much, very clear! And the speed is perfect for learning!
@dataschool
@dataschool 2 года назад
You're very welcome!
@davidpaez_co
@davidpaez_co 5 лет назад
You explain things wonderfully, thank you!
@dataschool
@dataschool 5 лет назад
You're welcome!
@joro8604
@joro8604 3 года назад
Well done! Thanks for going over the "proper" way first, and then the shortcuts. Most docs and tutorials, go straight to the shortcuts which is frusterating for a newb or even intermediate.
@dataschool
@dataschool 3 года назад
Great to hear!
@ashishganga420
@ashishganga420 6 лет назад
Awesome Tutorial for absolute beginners..Really appreciate that sir..Thank You...
@dataschool
@dataschool 6 лет назад
You are very welcome!
@chitranngoc9821
@chitranngoc9821 2 года назад
Excellent video. I learned a lot from this video. Thank you very much.
@dataschool
@dataschool 2 года назад
Glad it was helpful!
@selimtanrverdi9639
@selimtanrverdi9639 3 года назад
Very very useful series. Thank you so much.
@dataschool
@dataschool 3 года назад
You're welcome!
@contractorwolf
@contractorwolf 6 лет назад
thanks man, your explanation of how to use ix was helpful
@dataschool
@dataschool 6 лет назад
Great to hear!
@hhbbhvvbjhbbyjj
@hhbbhvvbjhbbyjj 2 года назад
wow this video is so clear and super helpful!
@dataschool
@dataschool 2 года назад
Thank you!
@FFGaming32207
@FFGaming32207 11 месяцев назад
Incredible explanation. Thanks a lot ❤❤
@dataschool
@dataschool 10 месяцев назад
You're welcome!
@TR3NDSETR
@TR3NDSETR 4 года назад
My brain is fried. I just watched 19 videos in 2 days and did every example also. But after watching I feel so much more confident. Im taking a class in a tech school currently, but your teaching is so much clearer. I learn more here, than in my class. My class is sooo fast, and long 5hr sessions at a time, its soo difficult to comprehend everything. Your videos are amazing. Thanks.
@dataschool
@dataschool 4 года назад
That is so awesome to hear... thank you so much!
@angelanganga2945
@angelanganga2945 2 года назад
Awesome video, very easy to understand. Thanks
@dataschool
@dataschool 2 года назад
Thank you!
@user-zy8sf7tv2f
@user-zy8sf7tv2f 3 года назад
Man you are incredible, thanks for your teaching.
@dataschool
@dataschool 2 года назад
I appreciate that!
@pphong
@pphong 6 лет назад
Thanks! Best explanation on loc/iloc!
@dataschool
@dataschool 6 лет назад
You're very welcome!
@harikrishna-harrypth
@harikrishna-harrypth 3 года назад
Your videos are very helpful! Thanks much!
@dataschool
@dataschool 3 года назад
Glad you like them!
@markslima1557
@markslima1557 Год назад
this video is a little older but great content great instruction - you are making this really clear for me
@dataschool
@dataschool Год назад
Thank you!
@dtsleite
@dtsleite 2 года назад
Great explanation and examples! helps a lot! Thanks!
@dataschool
@dataschool 2 года назад
You're very welcome!
@urso15
@urso15 4 года назад
Aside from the good video, your way of speaking makes the content easier to understand to non-English native speakers.
@dataschool
@dataschool 4 года назад
Great to hear!
@shreddersengupta7384
@shreddersengupta7384 3 года назад
I agree with you.
@goldensleeves
@goldensleeves 3 года назад
This is GREAT. I'm in a software school right now and they did a MUCH WORSE job of explaining this. THANK YOU for this video. Thumbs up
@dataschool
@dataschool 3 года назад
You're very welcome!
@lionelshaghlil1754
@lionelshaghlil1754 Год назад
very explicit and well explained. 👍Thanks
@dataschool
@dataschool Год назад
You're very welcome!
@nickiexu9919
@nickiexu9919 7 лет назад
So far the best tutorials for pandas that I've ever seen. I like you explained in great details in both codes and logic. Your speed is slow and clear, leaves great room for audience to think. The examples are well designed, serve well for the purpose. I will try to go thru all your videos! Congrats to you for your marriage! Do you have videos on Groupby?
@dataschool
@dataschool 7 лет назад
Wow, thanks so much for your kind words! I really appreciate it! I do have a video about groupby: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qy0fDqoMJx8.html Hope that helps!
@drhf1214
@drhf1214 5 лет назад
thank you so much. This video was very helpful. Thanks for the many examples.
@dataschool
@dataschool 5 лет назад
You're very welcome!
@UncleLoren
@UncleLoren 4 года назад
It's interesting that .loc, though not the conventional choice of expression when specifying rows by NUMERIC POSITION, does in fact work provided the row index names are numeric. In contrast, .loc is not an option when specifying columns by numeric position (well, not unless the columns had numeric names). This video series is great for both "beginners" and for those who want a refresher b/c they've been spending more time using data frames in R and want to keep their muscle memory flexible to both worlds. Thanks a million, Kevin!
@prashantjoshi8847
@prashantjoshi8847 7 лет назад
He is a great teacher,I wish he could be my professor,Great work Sir :-)
@dataschool
@dataschool 7 лет назад
Thanks so much, I appreciate your comment! :)
@CKPSchoolOfPhysics
@CKPSchoolOfPhysics 2 года назад
Thanks a lot man !! You did a great favour to me !! ❤️
@dataschool
@dataschool 2 года назад
Great to hear!
@vinodkumaryadav1292
@vinodkumaryadav1292 4 года назад
It's really a helpful supporting video to learn python 🐼... Most appreciated.. Thank you for your support
@dataschool
@dataschool 4 года назад
You're very welcome!
@manojkumarp1306
@manojkumarp1306 4 года назад
Great Explanation..Good work
@dataschool
@dataschool 4 года назад
Thanks!
@josephkarpinski9586
@josephkarpinski9586 6 лет назад
Very clear and informative. Thanks!
@dataschool
@dataschool 6 лет назад
You're welcome!
@dupsie4362
@dupsie4362 2 года назад
Fantastic teaching. Thank you 👏👏👏❤️
@dataschool
@dataschool 2 года назад
Thank you!
@sairohit8201
@sairohit8201 4 года назад
wonderful explanation
Далее
When should I use the "inplace" parameter in pandas?
10:19
My top 25 pandas tricks
27:38
Просмотров 265 тыс.
How do I handle missing values in pandas?
14:28
Просмотров 196 тыс.
How do I merge DataFrames in pandas?
21:49
Просмотров 157 тыс.
More of your pandas questions answered!
19:24
Просмотров 27 тыс.
How do I use the MultiIndex in pandas?
25:01
Просмотров 172 тыс.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30