Pandas Functions: Apply vs. Map vs. Applymap

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 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
    📹 TH-cam - / @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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 69

  • @misraturp
    @misraturp  2 ปีที่แล้ว +6

    👉 All you need to know about Pandas in one place!
    Download my Pandas Cheat Sheet (free)
    misraturp.gumroad.com/l/pandascs

  • @LuffyD-lv1lr
    @LuffyD-lv1lr 10 หลายเดือนก่อน

    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

  • @Kidpambi
    @Kidpambi 2 ปีที่แล้ว

    Definitly following this channel! this really helped with something im working at. Thanks

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      That's amazing to hear, welcome to the channel Alejandro!

  • @hoow_j
    @hoow_j ปีที่แล้ว +2

    The best explanation for novice!

  • @beloaded3736
    @beloaded3736 11 หลายเดือนก่อน

    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 🌹

  • @damienbates
    @damienbates 2 ปีที่แล้ว

    Thank you! I really appreciate your videos.

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      You're very welcome Damien!

  • @mhathunggeorge8082
    @mhathunggeorge8082 ปีที่แล้ว

    Simple yet very easy to understand...Thank you

    • @misraturp
      @misraturp  ปีที่แล้ว

      You are welcome!

  • @ahmadsaeed9954
    @ahmadsaeed9954 2 ปีที่แล้ว

    good to see you after a long time

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      Haha yes, I took a big break :) Thank you.

  • @KellenBegin
    @KellenBegin 2 ปีที่แล้ว +3

    thanks, your videos are very helpful for pandas/python/datascience

    • @misraturp
      @misraturp  2 ปีที่แล้ว +2

      Great to hear, thank you Kellen!

  • @stanTrX
    @stanTrX หลายเดือนก่อน

    Teşekkürler Mısra hanım

    • @misraturp
      @misraturp  หลายเดือนก่อน

      Rica ederim!

  • @GregThatcher
    @GregThatcher 2 หลายเดือนก่อน

    Thanks!

  • @a.5214
    @a.5214 2 ปีที่แล้ว

    amazing as always

  • @giri41
    @giri41 หลายเดือนก่อน

    Super .. more videos please

  • @ingluissantana
    @ingluissantana 2 ปีที่แล้ว

    Thanks for the video!!!

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      You're very welcome :)

  • @KitAjoc
    @KitAjoc ปีที่แล้ว

    thanks for lessons! this is great

    • @misraturp
      @misraturp  ปีที่แล้ว

      You're very welcome!

  • @elastvd7503
    @elastvd7503 ปีที่แล้ว

    Thanks ❤

  • @behradio
    @behradio 2 ปีที่แล้ว

    Thanks, that's very helpful👍

    • @misraturp
      @misraturp  2 ปีที่แล้ว +1

      Great to hear!

  • @user-zf3it3vw2e
    @user-zf3it3vw2e 10 หลายเดือนก่อน

    thank you

  • @karrostrachan5321
    @karrostrachan5321 ปีที่แล้ว

    Very good tutorial of the map, apply and applymap functions

  • @AbdelrahmanMohamed-ic7sl
    @AbdelrahmanMohamed-ic7sl ปีที่แล้ว

    I love your codes

  • @srikanthamigo
    @srikanthamigo 2 หลายเดือนก่อน

    Great Turp! really nice. Could u make a series on numpy

  • @JoshMelodyMusic
    @JoshMelodyMusic ปีที่แล้ว

    Nice class, your animation about topic are great

  • @aleman12345
    @aleman12345 ปีที่แล้ว

    thanks for this!

    • @misraturp
      @misraturp  ปีที่แล้ว

      You're welcome!

  • @user-uv6rk8mo3s
    @user-uv6rk8mo3s 11 หลายเดือนก่อน

    thanks

  • @kaifahmed316
    @kaifahmed316 ปีที่แล้ว

    Keep it up 👍

  • @user-zn3jr5zh9q
    @user-zn3jr5zh9q 5 หลายเดือนก่อน

    U are butifule teatcher❤ thank you

  • @caiyu538
    @caiyu538 ปีที่แล้ว

    Great

  • @pubgdoremongamer8823
    @pubgdoremongamer8823 ปีที่แล้ว

    love your videos and you are so beautiful teacher 😍😍

  • @muhammadsalar8905
    @muhammadsalar8905 2 ปีที่แล้ว +1

    First like, first view and first comment 👍

  • @shekharanalytics9337
    @shekharanalytics9337 ปีที่แล้ว +1

    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 ?

  • @AhmedMostafa-so2jp
    @AhmedMostafa-so2jp 2 ปีที่แล้ว +2

    Is it possible for me to only use .apply( ) method because I think it can do pretty much everything?

  • @osoriomatucurane9511
    @osoriomatucurane9511 11 หลายเดือนก่อน

    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.

  • @areal935
    @areal935 3 หลายเดือนก่อน

    for the first exemple why using pd.Series.str.capitalize woldnt work??

  • @TGR_MAYANK
    @TGR_MAYANK ปีที่แล้ว

    Thnks for providing this...
    i m from india by the way,
    can u make some videos on machine learning it would be helpful

    • @misraturp
      @misraturp  ปีที่แล้ว +1

      You're very welcome :)

    • @TGR_MAYANK
      @TGR_MAYANK ปีที่แล้ว

      @@misraturp 🥰🥰

  • @stansuen8072
    @stansuen8072 ปีที่แล้ว

    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).

  • @hemarun09
    @hemarun09 ปีที่แล้ว

    When I key in the code- a.applymap(function, na_action='ignore') I am getting this error - 'Series' object has no attribute 'applymap'

  • @Virtualexist
    @Virtualexist ปีที่แล้ว

    apply: 3:00
    applymap: 3:51
    map: 5:40

    • @misraturp
      @misraturp  ปีที่แล้ว +1

      Thank you!

    • @Virtualexist
      @Virtualexist ปีที่แล้ว

      @@misraturp Thanks to you ma'am for making to the point tutorials.

      🤌

  • @himanshupandey9902
    @himanshupandey9902 2 ปีที่แล้ว +2

    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.

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      You are very welcome Himanshu! And thank you for the suggestion, added to my ideas list!

  • @sumanlama6138
    @sumanlama6138 ปีที่แล้ว +1

    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?

    • @misraturp
      @misraturp  ปีที่แล้ว +1

      Not by using this option. You can achieve that by using conditional applys.

  • @Day_Dream_Believer788
    @Day_Dream_Believer788 ปีที่แล้ว

    You’re probably going to say no, but will you Mary me?

  • @zzye553
    @zzye553 24 วันที่ผ่านมา

    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