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
  • НаукаНаука

Комментарии • 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

  • @Kidpambi
    @Kidpambi 2 года назад

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

    • @misraturp
      @misraturp  Год назад

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

  • @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

  • @KellenBegin
    @KellenBegin 2 года назад +3

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

    • @misraturp
      @misraturp  Год назад +2

      Great to hear, thank you Kellen!

  • @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 🌹

  • @mhathunggeorge8082
    @mhathunggeorge8082 Год назад

    Simple yet very easy to understand...Thank you

  • @damienbates
    @damienbates 2 года назад

    Thank you! I really appreciate your videos.

    • @misraturp
      @misraturp  Год назад

      You're very welcome Damien!

  • @hoow_j
    @hoow_j Год назад +2

    The best explanation for novice!

  • @ahmadsaeed9954
    @ahmadsaeed9954 2 года назад

    good to see you after a long time

    • @misraturp
      @misraturp  Год назад

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

  • @giri41
    @giri41 Месяц назад

    Super .. more videos please

  • @a.5214
    @a.5214 2 года назад

    amazing as always

  • @stanTrX
    @stanTrX Месяц назад

    Teşekkürler Mısra hanım

  • @KitAjoc
    @KitAjoc Год назад

    thanks for lessons! this is great

  • @behradio
    @behradio 2 года назад

    Thanks, that's very helpful👍

  • @ingluissantana
    @ingluissantana 2 года назад

    Thanks for the video!!!

  • @karrostrachan5321
    @karrostrachan5321 Год назад

    Very good tutorial of the map, apply and applymap functions

  • @GregThatcher
    @GregThatcher 2 месяца назад

    Thanks!

  • @srikanthamigo
    @srikanthamigo 2 месяца назад

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

  • @JoshMelodyMusic
    @JoshMelodyMusic Год назад

    Nice class, your animation about topic are great

  • @AbdelrahmanMohamed-ic7sl
    @AbdelrahmanMohamed-ic7sl Год назад

    I love your codes

  • @aleman12345
    @aleman12345 Год назад

    thanks for this!

  • @elastvd7503
    @elastvd7503 Год назад

    Thanks ❤

  • @kaifahmed316
    @kaifahmed316 Год назад

    Keep it up 👍

  • @user-zf3it3vw2e
    @user-zf3it3vw2e 9 месяцев назад

    thank you

  • @user-uv6rk8mo3s
    @user-uv6rk8mo3s 10 месяцев назад

    thanks

  • @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 ?

  • @pubgdoremongamer8823
    @pubgdoremongamer8823 Год назад

    love your videos and you are so beautiful teacher 😍😍

  • @muhammadsalar8905
    @muhammadsalar8905 2 года назад +1

    First like, first view and first comment 👍

  • @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?

  • @caiyu538
    @caiyu538 Год назад

    Great

  • @user-zn3jr5zh9q
    @user-zn3jr5zh9q 5 месяцев назад

    U are butifule teatcher❤ thank you

  • @osoriomatucurane9511
    @osoriomatucurane9511 10 месяцев назад

    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.

  • @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

  • @areal935
    @areal935 3 месяца назад

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

  • @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'

  • @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  Год назад

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

  • @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.

      🤌

  • @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.

  • @zzye553
    @zzye553 9 дней назад

    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

  • @Day_Dream_Believer788
    @Day_Dream_Believer788 Год назад

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