How do I select multiple rows and columns from a pandas DataFrame?
Вставка
- Опубліковано 6 чер 2016
- 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:
ua-cam.com/users/dataschool?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
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: ua-cam.com/video/te5JrSCW-LY/v-deo.html
Data School c
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.
thanks for the update, you're the best!
thanks for update.
you are genious
I love how he teaches, slow, thorough, easy to understand and with plenty of examples
Thanks so much for your kind comment!
I watch it with 1.75 speed and still understandable
Still applies today! I love it!
Your voice tone is perfect for learning. Great video!
Thanks! :)
he sounds like nile red
Congratulations on your marriage! Thanks for making awesome data school videos, I learned and refreshed lots of my Python skills here.
Thanks for your kind words! :)
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.
Great to hear!
Your pace is excellent! I like how you show the different options and recommendations. Keep up the good work!
Thanks so much! I'm glad the pace and style of my videos is helpful to you!
Just wanted to pile on the accolades, thanks. Perfectly paced, clear, succinct. It was just what I needed.
Great to hear! Thanks so much for your kind comment.
After a few days of reading pandas documentation and numerous 'tutorials' I finally get a general principle of how loc/iloc works, thank you!
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!!!
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!
Thanks so much for your incredibly kind words! I very much appreciate it! And yes, we are still married :)
Have watched this videos to refresh myself on two separate occasions. Very clear and concise with excellent examples. Thank you!
Thanks for your kind words!
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
You're very welcome! Glad it was helpful to you :)
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!
You are so very welcome!
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!
Wow, thank you so much for your incredibly kind comment! It's really great to hear that the series is useful to you!
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.
Great to hear!
Your explanations have been one the of best I have found so far on dataframes!
Thanks very much for your kind words!
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.
🙌
Your explanations are clear and comprehensive. Glad I found your channel. Look forward to viewing more of your videos. Thank you!
Thanks so much for your kind comment!
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.
You're very welcome!
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.
I'm glad to hear that my teaching style works for you! Really appreciate your comment :)
Dude this was like the one function that I couldn't comprehend. Thanks a ton!
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 !!!
You're welcome!
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.
Thanks for your kind words!
Your tutorials are very useful, and contain a good number of use cases for the duration. Thank you!
Glad it was helpful!
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
Thanks so much!
Wow, best explanation on iloc/loc I have ever seen !!! Thank you for sharing!!!
Thanks so much! I worked very hard on that video :)
the best explanation I've come across, and it actually applies to all your videos. Thank you!
Big thanks for your job!!! Do not stop. too many people need video tutorials like this. waiting your new videos.
More to come soon!
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
Glad it was helpful!
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.
That is so awesome to hear... thank you so much!
Still...
The best videos for Pandas on UA-cam!
Thank you!
Thank you!
Thank you for being patient and really informative!
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!!!
You're very welcome! 😄
I really have not found explanations as clear as this.Thank you Steven
Glad it was helpful to you!
Congratulations on your Marriage!!
And thanks for creating so neat and informative videos, learned a lot, I really appreciate it.
Thanks again!
Thanks so much for your kind words and your well wishes! :)
Very nice systematic break down of how to drill into a dataFrame. It was worth my time to watch this video.
Great to hear!
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.
Great to hear!
Thanks for these videos - hands down the best videos online for learning how to data science.
Thank you so much for your very kind comment!
your way of teaching is too good sir.thanks a lot
Amazing video. Been a few years since i last had any work related to Python.
Thank you!
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.
Thank you so much! I'm so glad to be of help to you!
The pace and tone is excellent. Thanks for making the simple things clear. I am a subscriber now
Thank you! 🙏
Great video. Your voice is very clear even when sped up and you explained the concepts very well. Thank you.
You're very welcome!
this is the most clear version of this I've found! great stuff
Thank you!
Another winner of a video that cuts through the fog usually surrounding these methods. And congrats on the wedding.
Thanks very much! :)
I think you're the best data science python tutor I had seen :D
Thank you!
Thank you so much, I've been stuck on this issue for ages!
You're very welcome!
I found your video because I got this Warning: SettingWithCopyWarning:
And you helped me to fix that issue.
Thanks you a lot from Perú.
I know these vids are older, but thank you. You are an excellent teacher!
Thank you!
Thank You for this!!! I had so confusions regarding this topic and looking for a such a clear and informative video.
Glad it was helpful!
My friend, you have no idea how useful was this lecture for me. Pandas was turning in such a nightmare. And I don't even use it, ascii files have been good enough for me until today. But as a python user I wanted to check what I was missing with Pandas, and after many tries I was not understanding its logic. Even worse, I tried with MultiIndexed files from the beginning, so I was hopelessly crashing against a wall. But your input was really illuminating. So many subtleties.Thanks a lot! And best wishes in your marriage and future plans. Cheers
That is so great to hear, thank you for sharing! I really appreciate it!
Thank you for the great instruction and welcome to the club!
You're welcome!
12:21 nice summary of loc() vs iloc(), lots of good information
Thanks!
Thank you so much for this video. Very easy to understand and comprehensive.
Glad it was helpful!
Most useful tutorial I've seen so far. Brilliant!
Wow, thanks!
Wow
This is a beacon of light in a sea of generally pretty badly presented and confusing UA-cam vids/moocs/other resources (including paid ones!) about pandas.
Thank you for taking the time to make this video. It addresses such an obvious point of confusion that, having seen it, I'm left wondering why almost no one else takes the time to clarify the differences between the three indexing methods.
I particularly liked the fact that you didn't just present syntax, you gave the reasons why the syntax is the way it is. So much pandas (and some python) teaching simply presents syntax with the expectation that you'll remember it. When you understand why it is how it is, you don't need to commit half as much stuff to memory.
Thanks
Thanks so much for your thoughtful compliment! For every video, I spend a lot of time thinking about what to present, how to present it, and what details to include and exclude. I'm so glad to hear that my teaching methodology works well for you!
you are a very good teacher ...thanks again...i'm always using loc from now on
Thanks for your kind words!
Best channel for learning python... kudos to you 👏
Thank you!
Excellent explanation: was perplexed by various indexing protocols previously. Great pace and explanation was really helpful.
Great to hear!
Excellent video, very clear and practical description. I will watch your other videos on Python and Pandas as well. Thanks a lot.
Thanks for your kind words!
Thank you! That's just what I've looked for, in brief
Glad it was helpful!
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
You're very welcome!
SUPER CLEAR TUTORIALS. NICE JOB
THANKS!
Very nice video, Clearly understand the loc, iloc concept.
Great!
your lectures and your examples are very nice , thank you
Thanks!
great explanation, perfect voice tone and pace
Thanks George!
I'm only 4 minutes in and already, thank you thank you thank you!!!
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!
You did a great job!
Happy wedding!
Thanks! :)
Very clear and sound explanation. Thanks a lot Kevin!!
You're very welcome!
Thanks for detailed explanation, able to solve my problem and understand in detail about loc
Great to hear!
Each video is nicely explained. Well done. Thankyou somuch for sharing these video.
You're very welcome!
Thank you very much, I like your video very much, very clear! And the speed is perfect for learning!
You're very welcome!
Great Video! Ideal for a beginner like me. you explain everything in detail and straight to the point.
Thank you!
Good!
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?
Wow, thanks so much for your kind words! I really appreciate it!
I do have a video about groupby: ua-cam.com/video/qy0fDqoMJx8/v-deo.html
Hope that helps!
Aside from the good video, your way of speaking makes the content easier to understand to non-English native speakers.
Great to hear!
I agree with you.
Liked before watching, coz I know whats coming!
:)
Brilliant. You are a star. You must do more videos in python machine learning and NLP
Your videos help me save a lot of money! Thanks!
Great to hear! :)
If had a million dollar with me, I would straight up come to you and give you the cash and learn from you. OMG!! You are a gem sir.
I am new to Python. I'm finding all your videos extremely useful. Beautifully explained, clear and concise. Slow and steady.
What else does one need!
Hats off!!!! Thank you so much.
WOW! Thank you so much! I really appreciate your kind words! 🙏
He is a great teacher,I wish he could be my professor,Great work Sir :-)
Thanks so much, I appreciate your comment! :)
Your videos are very helpful! Thanks much!
Glad you like them!
Incredible explanation. Thanks a lot ❤❤
You're welcome!
Man you are incredible, thanks for your teaching.
I appreciate that!
wow this video is so clear and super helpful!
Thank you!
Very very useful series. Thank you so much.
You're welcome!
Excellent video. I learned a lot from this video. Thank you very much.
Glad it was helpful!
Awesome video, very easy to understand. Thanks
Thank you!
Remarquable et très pédagogique! Félicitations pour la qualité de votre prononciation. Thanks a lot!
You're very welcome!
You explain things wonderfully, thank you!
You're welcome!
Great explanation and examples! helps a lot! Thanks!
You're very welcome!
this video is a little older but great content great instruction - you are making this really clear for me
Thank you!
This videos are awesome. Simple and clear. Thanks a lot brother.
Thanks so much for your kind words!
Thanks! Best explanation on loc/iloc!
You're very welcome!
Clear and concise, well done!
Thanks!
I'm amazed at the clarity with which you explain those concepts and teach how to use them in a professional manner. I'm really glad I found your youtube channel!
Can I also ask you what technique would you recommend to copy ranges and paste them into another excel file (appending, not overwritting)?
Thank you very much for your shared knowledge.
Thanks very much for your kind words! Really appreciate it.
As for your question, I don't know off-hand, but you could search through the API documentation to see if anything is available: pandas.pydata.org/pandas-docs/stable/api.html
Once again, extremely helpful! I'll look it up.
Thank you for your kindness.
thank you so much. This video was very helpful. Thanks for the many examples.
You're very welcome!
Thanks a lot man !! You did a great favour to me !! ❤️
Great to hear!
Very well explained. Thank you very much.
You're welcome!
Awesome Tutorial for absolute beginners..Really appreciate that sir..Thank You...
You are very welcome!