Pandas Functions: Apply vs. Map vs. Applymap
HTML-код
- Опубликовано: 30 июн 2024
- Pandas map, apply and applymap functions work in a similar way but the effect they have on the dataframe is slightly different. Today we will look closely into how each function works and the differences they have from each other.
You can find the code and the dataset here: github.com/misraturp/Pandas-a...
00:00 Intro to apply functions
03:00 Apply in practice
03:51 Applymap in practice
05:40 Map in practice
👋 Keep in touch?
==========================
🐥 Twitter - / misraturp
🔗 LinkedIn - / misraturp
📹 RUclips - / @misraturp
🌎 Website - misraturp.com/
Courses & resources
============================
📙 Fundamentals of Deep Learning in 25 pages
misraturp.gumroad.com/l/fdl
👩💻 Hands-on Data Science: Complete your first portfolio project
www.misraturp.com/hods
📥 Streamlit template
misraturp.gumroad.com/l/stemp
🤖 Deep Learning 101 with Python and Keras (FREE)
• 50 Days of Deep Learning
🏃♀️ Data Science Kick-starter mini-course (FREE)
www.misraturp.com/data-scienc...
🐼 Pandas cheat sheet (FREE)
misraturp.gumroad.com/l/pandascs
📝 NNs hyperparameters cheat sheet (FREE)
misraturp.gumroad.com/l/hcs Наука
👉 All you need to know about Pandas in one place!
Download my Pandas Cheat Sheet (free)
misraturp.gumroad.com/l/pandascs
Definitly following this channel! this really helped with something im working at. Thanks
That's amazing to hear, welcome to the channel Alejandro!
well explained thanks a lot even the paid resources i have didn't explain how the operations working behind the scene this is exactly what i needed
thanks, your videos are very helpful for pandas/python/datascience
Great to hear, thank you Kellen!
Miss Turp, you are really a marvel, your knowledge is so deep and you are excellent teacher. Thanks for knowledge you are sharing so selflessly 🌹
Simple yet very easy to understand...Thank you
You are welcome!
Thank you! I really appreciate your videos.
You're very welcome Damien!
The best explanation for novice!
Thank you!
good to see you after a long time
Haha yes, I took a big break :) Thank you.
Super .. more videos please
amazing as always
Thank you!
Teşekkürler Mısra hanım
Rica ederim!
thanks for lessons! this is great
You're very welcome!
Thanks, that's very helpful👍
Great to hear!
Thanks for the video!!!
You're very welcome :)
Very good tutorial of the map, apply and applymap functions
Thank you!
Thanks!
Great Turp! really nice. Could u make a series on numpy
Nice class, your animation about topic are great
Thanks a lot
I love your codes
Awesome!
thanks for this!
You're welcome!
Thanks ❤
Keep it up 👍
Thanks!
thank you
thanks
Great Explanation . Consider me your fan for really making this simple .
May I have a question please ?
I have two dataframes (df1,df2) . df1 has two columns key,overide_value.
df2 has key,region,calculated_value.
in order to replace values in df2['calculated_value'] with df1['overide_value'] ; if key of df2 has matching value in key of df1 ? I dont want to use joins though .
As per my understanding through your vedio . I believe , in order to use map , i will have to convert df1 into dictionary .
Is that viable ?
love your videos and you are so beautiful teacher 😍😍
Thanks!
First like, first view and first comment 👍
Legend!
Is it possible for me to only use .apply( ) method because I think it can do pretty much everything?
Great
Thank you!
U are butifule teatcher❤ thank you
Awesome tutorial, the best by far on the matter. Mastering user defined functions is a great skill and it separates newbies from power users. I am aware that functions are always handy specially when you have a repetitive task where you could get he job done without hassles. I got the same result without apply(), just using data['Civil Service Title'].str.lower().str.capitalize(). Not sure if it always works. Could someone kindly explain me why and when is advised or recommended to opt for apply(), map(). I mean, is there any reason other than performance related where we should rely on apply ()and map() with in-built or user defined functions when applying a function or method to an object? Thank you in advance for the hint.
Thnks for providing this...
i m from india by the way,
can u make some videos on machine learning it would be helpful
You're very welcome :)
@@misraturp 🥰🥰
for the first exemple why using pd.Series.str.capitalize woldnt work??
Thanks for a great video. If I want to create a new column by formula that takes in data from different rows, can we use apply? For example, I want to calculate the Rate of Change of stock price from say 5 days ago, how do I pass the value of the closing price of current row and of 5th previous rows? I know how to do it by looping / iterrows but just wonder if there is a faster way to do it by apply (or even vactor).
you can use apply
When I key in the code- a.applymap(function, na_action='ignore') I am getting this error - 'Series' object has no attribute 'applymap'
correct
Thanks so much. when you deal with data as a beginner. These pandas fuctions seem little tricky. You made them easier to understand. I learnt pandas in practice by your pandas playlist. If you can, I request to make some new videos of complete Eda with data cleaning , and then into a model deployment. Thanks again.
You are very welcome Himanshu! And thank you for the suggestion, added to my ideas list!
apply: 3:00
applymap: 3:51
map: 5:40
Thank you!
@@misraturp Thanks to you ma'am for making to the point tutorials.
✨
🤌
When you used s.map({"cat":"kitten","dog":"puppy"}), it changed cat to kitten and dog to puppy but also changed rabbit to NAN is there a way to keep rabbit to rabbit without putting that in dictionary?
Not by using this option. You can achieve that by using conditional applys.
Wow I admired your accent If you are not married please tell me I want my kids to speak fluent english like this! Anyways great job
You’re probably going to say no, but will you Mary me?