Most people would have simply demonstrated the short way, but by taking the time to elucidate what's happening behind the scenes, you're performing a far greater service. Great job.
Him: So here's how you filter out by certain values. Me: *Copies code* Gotacha, thanks. Him: But that's the long way and you'd never actually do that Me: Oh haha of course. *deletes code*
I like your in-depth explanation of _how_ it works, rather than a "recipe" of "just do it this way" without explaining _why_ it works. Now I'm off to see what other videos on pandas you have!
Excellent! I'm glad the depth of the explanation was helpful to you! My complete pandas playlist is here: ru-vid.com/group/PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y
Thank you so much. I'm new to pandas as this was very helpful, I couldn't understand why it wasn't obvious how to filter rows. You explained it so clearly.
Awesome explanation! I have referred to some resources on pandas earlier and felt like i could easily skip your content to get through faster and grab only the unknown piece of code in the process . But the way you explain things it shows your hold on pandas and i am highly motivated to go through the full video. Cheers great job.
I loved how you showcased every possible way, from the heavy technique of using a for loop and then right to using operators. It made things absolutely clear. Thanks!!
You are the best Pandas teacher on RU-vid. I saw your previous videos as well but this is by far the best. You made the whole concept so simple. Thank you very much
Your videos really are terrifically helpful, explaining things thoroughly from base concepts upwards as you do is just brilliant and your explanations are always extremely clear and precise. Thank you so much for all the time you spend on this - I'm tremendously grateful as I'm sure are many others.
Thanks so much, I appreciate it! :) Right now, I only sell one course, called Machine Learning with Text in Python: www.dataschool.io/learn/ But if you want to hear about new courses that I release, just subscribe to my newsletter: www.dataschool.io/subscribe/
+Alessandro Sarretta You're welcome! I think you will find that understanding how it works in this case will help you to better understand lots of other pandas functionality!
Great videos! I have been struggling with the ideas and concepts behind decision trees and ensembles. I hope these are topics that you will cover in the future and if not, I would really appreciate any resources to gain a deeper understanding of this topic. Thank you!
Thanks! Regarding decision trees and ensembles, I highly recommend chapter 8 of this book for a conceptual understanding: www-bcf.usc.edu/~gareth/ISL/ Here are videos related to that book: www.dataschool.io/15-hours-of-expert-machine-learning-videos/ For Python code and more resources, see classes 17 and 18 of my data science course: github.com/justmarkham/DAT8 Hope that helps!
Many thanks for revealing the mystery behind the weirdness of the filtering syntax. I've been using it already, but now I realize the reason behind it, which is pretty cool!
You're very welcome! I find that understanding filtering helps you to better understand how to use pandas as a whole, which is why I decided to explain it. Glad it was helpful to you!
I am in heaven right now. "You get to understand what things are when you know what it is they do." I really love the fact that you provide the "nuts and bolts" it helps me better understand the "how and the why."
I've learnt so much through watching this one video. Thank you. Now, I may need to re-write some my existing codes to make it more efficient and simple to comprehend. :-)
Thanks so much! Excellent step by step explanation of the concept and method! Your clear explanation shows how well you have those concepts and logic embedded in you brain 🙂 Must subscribe!
Best explanation I found so far. Thank you very much! But there is a tiny but very important bit missing: How can I filter by MORE then one criteria?????????
Good afternoon. "Long time listener, first time caller." I really like your videos and your teaching style. As others have noted, you explain things clearly and in digestible and understandable chunks, which I appreciate. I have a question and/or a request for Q&A video. I am comparing dataframes. I am using a merge statement and a "fulll outer join". This works well for identifying records from both dataframes that do not match each other. Going a step further, I'd like to identify the individual attributes (i.e., columns) that do not match. My use case is that I often compare extremely wide datasets (200+ columns) and it is sometimes difficult to find the "offending/differing" column(s). I have researched at various places online, and have yet to find a solution that truly fits my needs.
Thanks for your kind words! That's an interesting question, I'm not sure if I 100% understand. It would be super helpful if you could code up a simple example (just a few columns) of what you are currently doing and explain exactly what your goal is. Thanks!
Beautiful teaching technique. You purposefully did it the long way first. Wow!. So the condition that I always used in [ ] in pandas is actually just a Boolean Series whose length matches the length of the dataframe.
Hey man, you are doing a great work! I have the following question, though: What if I want to filter the data frame by a column that contains a list (actors_list) but only if an exact element (string) is present in that list? Let's say "I want every movie (data frame row) in which Al Pacino plays" ? Thank you in advance and keep up the good work!
Maybe I am insane because the mispronunciation of Boolean (which should be "BOOL-EE-UN") made this video very hard to watch. :( Information is great. Too bad I'm such a freak. lol
@AchinGupta I completely agree. You break down the methods so they are very easy to understand. This is definitely helped by the fact that you have a solid grasp of pandas! Thanks again
Wow, that's such a lucid explanation of things. Thank you so much for this fantastic effort👍👍👍. Can you please point towards a resource or let me know how to add multiple conditions like AND / OR etc?
This video was great! Thanks. I have a dataframe that I need to pair 2 rows of data, each have there own timestamp, drop the second timestamp and then filter the data with these pairs. I have alot of data to sort through, any help would be great
I had to put Python on the back-burner for too long, back in the game now ;) Great series to get up to speed quickly on some key topics.. Quick question: how do we sort the rows in an ascending / descending way after applying the "movies.duration >= 200" ?
Thank you so much! Thanks to you, i have finally entirely solved my problem!!! I love how you fully explain everything!! I very much enjoyed this. I'm new to your channel but you sir have earned a Subscribe! I will definitely be back for more videos!
Yes, I took their online Intro to Python for Data Science class. Good teaching of very basic stuff. Their platform was easy and intuitive to learn and use. Not perfect, though. I like Jupyter notebooks better!
Very well explained! I was able to filter some data from a huge CSV file with your help! My first python program! =) import pandas as pd df = pd.read_csv('huge.csv',delimiter=";") chosen_ncm = 27129000 booleans = [] for ncm in df. CO_NCM: if ncm == chosen_ncm: booleans.append(True) else: booleans.append(False) filtered_ncm = pd.Series(booleans) out_csv = 'filter_result_' + str(chosen_ncm) + '.csv' df[filtered_ncm].to_csv(out_csv)
Hi Kevin! Thank you so much for the .loc tip! I was finally able to solve one of the things that annoyed me the most: assigning values to a new column based on values in one or more existing columns :) I sometimes prefer using .ix rather than .loc, since .ix is a flexible wrapper over .loc and can handle both label and numeric row selections. The syntax is strangely reminiscent of the R data,table [i, j, by] format, which I find very handy. Thanks again!