25 Nooby Pandas Coding Mistakes You Should NEVER make.

263,713
0
Published 2022-09-07
In this video I go over my list of 25 mistakes commonly made my beginners learning pandas in python. Pandas is a great tool, but there are some pitfalls to avoid!

Shoutout to mCoding who inpired the idea for this video! youtube.com/c/mCodingWithJamesMurphy

Follow me on twitch for live coding streams: www.twitch.tv/medallionstallion_

My other videos:

Speed Up Your Pandas Code:    • Make Your Pandas Code Lightning Fast  
Intro to Pandas video:    • A Gentle Introduction to Pandas Data ...  
Exploratory Data Analysis Video:    • Exploratory Data Analysis with Pandas...  

Working with Audio data in Python:    • Audio Data Processing in Python  
Efficient Pandas Dataframes:    • Speed Up Your Pandas Dataframes  

* Youtube: youtube.com/@robmulla?sub_confirmation=1
* Discord: discord.gg/HZszek7DQc
* Twitch: www.twitch.tv/medallionstallion_
* Twitter: twitter.com/Rob_Mulla
* Kaggle: www.kaggle.com/robikscube

#python #pandas #datascience

All Comments (21)
  • I need to implement the chaining methods and using functions into what I do, much easier to use and read. Great video as always.
  • @vishnurj6207
    Please keep doing this. No additional jargon, crisp, straight to the point explanations are what are required. No body needs a 10 hour tutorial. Thank you for this.
  • @akmalmir8531
    00:18 #1. Writing into csv with unnecessary index 00:53 #2. Using column names which include spaces 01:25 #3. Filter dataset like a PRO with QUERY method 01:44 #4. query strings with(@ symbol) to easily reach variables 02:07 #5. "inplace" method could be removed in future versions, better explicitly overwrite modifications 02:35 #6. better Vectorization instead of iteration 03:01 #7. Vectorization method are preferable than Apply method 03:30 #8. df.copy() method 04:08 #9. chaining formulas is better than creating many intermediate dataframes 04:28 #10. properly set column dtypes 05:01 #11. using Boolean instead of Strings 05:25 #12. pandas plot method instead of matplotlib import 05:45 #13. pandas str.upper() instead apply and etc 06:10 #14. use data pipeline once instead of repeating many times 06:41 #15. learn proper way of renaming columns 06:59 #16. learn proper way of grouping values 07:31 #17. proper way of complex grouping values 08:01 #18. percent_change or difference now could be implemend with function 08:25 #19. save time and space with large datasets with pickle,parquet,feather formats 08:58 #20. conditional format in pandas(like in Microsoft Excel) 09:22 #21. use suffixes while merging TWO dataframes 09:48 #22. check merging is success with validation 10:13 #23. wrapping expression so they are readable 10:33 #24. categorical datatypes use less space 10:55 #25. duplicating columns after concatenating, code snippet
  • Matt Harrison's "Effective Pandas: Patterns for Data Manipulation" is one of the best resources I've read on idiomatic pandas.
  • @DeadLine171
    I have been working 2 years now with pandas and I can strongly affirm that I have made like 70% of those bad practices, appreciate a lot your video!
  • I thought I was pretty good in Pandas, but you gave me so many new things to improve. HUGE thank you!
  • The pandas query function does not outperform the loc method. In fact, it is sometimes much slower when your query/data is so big. We industry users will utilize the loc method for quick EDA. Query might be useful when you have a scheduled cron
  • @kaymaqsood8920
    Rob, thank you for all the time and energy you have put in for us. Would appreciate an updated video on "Exploratory Data Analysis" may be expanding on your year old one. Thank you again!
  • I started to watch your videos recently, and from now on I'm doing the chaining and putting each function in "one row" to make the data cleaner, and also, the query method, so powerful and simple, I was used to replicate the dataframe with the column and value searched to filter my df. You are boosting my studies! Thanks for that!
  • @JustCrateIt
    I can't believe how good this video is. I love your no-nonsense delivery; I don't have time at work to watch a 4-hour "intro" video. Keep it up!
  • @julsmanbr8152
    Awesome stuff. I've been using pandas for over 4 years, but it never occurred me to start using the query method instead of loc (despite me finding it tiresome to keep repeating "df" all over the place when using loc). I also appreciate the quick format. You see YouTubers taking too long to say nothing at all, so congrats on actually going through 25 tips in 10 minutes. You got yourself a sub!
  • This can be, some of my first times commenting in youtube after years of usage. This video was INCREDIBLY USEFUL! There's a lot of my previous team members did on scripts and sometimes are complicated to maintain or create new ones following the same logic. This covers exactly what they used and what is the best option to rewrite it and make it more understandable. Thank you so much for this godly information.
  • @ryantakers
    I'm currently working on my first major pandas project and I reckon that I may have done around 15/25 of these 'mistakes'. Looks like I have some optimisation to do over the coming days!
  • @TravisGore-ep4yk
    I can't believe I watched this whole video and only 2 of them were things I didn't know about! Thank you for sharing!
  • @emily2e2e
    This is awesome, I’ve been wanting to know what are the better ways to write my code and why. Please continue to make these videos.
  • @NERGYStudios
    Learned more about Pandas in this video than a whole many videos worth hours combined. Seriously, thank you.
  • @digitsphinx
    oh wow the quality and clarity is worth subscribing! thank you !
  • @ladiesperfume
    Wow dude! You are single handedly responsible for my data science growth. PLEASE keep making more of these videos I really appreciate it.
  • @SuperOMERH
    This video is amazing, I am using pandas for a long time now and still learned so many new good practices thank you
  • Really enjoyed how fast this content came. I felt like it was a great speed to keep me engaged. I usually find these types of videos boring.