Pandas Functions: Three Ways to Use the Apply Function

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 76

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

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

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

    Great Content, Just Keep going.
    I have to learn a lot from you.

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

      Glad to hear that!

  • @jean-bernardsaint-eve3340
    @jean-bernardsaint-eve3340 2 года назад +2

    Nice, you are back, thanks for this great video

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

      Yes, and there is more to come! :)

  • @tomrhee1
    @tomrhee1 7 месяцев назад

    By the way, the output I would like to have is Intercept if we have the constant term in the regression, and all other regression regressions; R^2, and STEYX. Thanks in advance.

  • @tomrhee1
    @tomrhee1 7 месяцев назад

    I am wondering if you could help me with the "Rolling Multiple Regression" method with window size held constant. Not many people show this on RUclips. Thank you in advance.

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

    this video is great. Very simple explanation and easy to understand. Thanks

  • @munivoltarc
    @munivoltarc 9 месяцев назад

    you are so gorgeous, and explaining subject so easily to all, wondaful work, keep it up, could you explain OHLCV data, apply, map functions, user defined functions to to find the trend on the High, Low columns, to get buy signals and sell signals by not using any price lagging indicators.

  • @jahironmateoguzman5497
    @jahironmateoguzman5497 Год назад +1

    I've been learning many related stuff about data for the las year and as a personal challenge I decided to do it in english while my native languaje is Spanish, with you that's not a problem, your tone of voice and speed are just perfect as well everything you explain just fit into my mind right away. Looking foward to learn wit you about deep learning since I saw you have a playlist for that topic. I really like the way you transmit information in such as understandable way.

  • @frictionless
    @frictionless 4 месяца назад

    I love your videos. Keep up the good work! :)

  • @zhansayabauyrzhanova2492
    @zhansayabauyrzhanova2492 5 месяцев назад

    Well explained, thanks ❤

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

    I am sorry but "axis = 0" refers to rows while "axis = 1" refers to columns

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

      She does explain but easy to miss. You can apply. Let’s say implement to not get confused here… you can implement the apply function to either a whole df or to its series (columns). If you implement the apply function to a series it will apply the given function to each row in the series.
      So if you use the arg axis = 1 in the apply function itself. You are saying implement the apply function to the columns of the df. So now it will implement the function specified in the apply function arg (like np.mean) on each of the rows of the column in the df.
      Hope that helps

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

    The last bit was interesting 💯

  • @marceloherdy2379
    @marceloherdy2379 Год назад +1

    I discovered your channel yesterday and I must confess that I am very impressed with your way of explaining. Congratulations on your work and thanks for the videos! 😉

  • @bubblebath2892
    @bubblebath2892 4 месяца назад

    Great video ...very simplified and easy to understand ...and look great

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

    Thanks!

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

    love you 🤫

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

    Hello Misra, Thanks a ton for uploading this video. Please help if I have to update one column for eg. the salary column based on the condition on another column (here we can take posting type column). The condition is that for all those rows whose posting type is external, the salary column should be incremented by 2000 and for the rest salary should be incremented by 1000. How can this be done in pandas using the apply function.

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

    Awesome, I able understand fully. Thanks

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

    This is Cool Turp !! There is a space between attributes which is causing lot of issue while copying variables in script !! Great explaining with the data !! This helps 1!! cheers !!

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

    ah great! just started learning python and rite into pandas because i need it spacifically. You have explained this better then anyone else i have found. Also you are beautifal like Eva Mendes.

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

    Superb Explanation :)

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

    Mam not received mail of cheatsheet 😑

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

    Def common_word(row):
    ...........
    df['word_c'] =df.apply(common_word, axis =1)
    It's not creating a new column
    Error----> AttributeError : 'float' object has no attribute 'split'

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

      Can you creat a function and use that function as a new column that will going to help me

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

    Happy to see you back!!! Thanks a lot for this videoooo!!! 🙏🏼🙏🏼🙏🏼

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

      It’s good to be back at it :) you are very welcome!

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

    Thank you very much.. I have been looking for this.. I have df which contains billions of raw data. I had to make formulas for calculations and KPIs. using apply helped alot in terms of processing time. I cant thank you enough.

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

      That's amazing to hear! You're very welcome :)

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

    Great video!

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

    Thank you, great content.
    that’s an obvious and instructive explanation. For being more comprehensive, you could state apply, map and applymap functions at the same video next time.
    best wishes 🙂

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

      That is actually my next video. :) I'll upload it in a couple of days!

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

    Lovely! I'm learning python right as part of my data science degree, we just touched on pandas. Very informative videos. Very insightful content here!

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

    Thanks, you took a long leave from you tube. Your videos helped me. So thanks.

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

      Yes, I was on holiday for a while. :) That's great to hear Himanshu, you are very welcome. :)

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

    Hi Misra, I have started learning pandas to work one of my project and your videos really helped me. You are a great educator! Best wishes :)

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

      Great to hear Tejas, thank you!

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

    Thanks a lot Misra that’s a really good content, well explained !

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

    Thanks

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

    I am participating in a Data Science Bootcamp at the moment. The material that you provide takes so much frustration off! Thanks a lot Misra.

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

      That's great to hear! Thanks Daniel! Good luck with the bootcamp. :)

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

    Thank you. Really, thank you. From brazil

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

    Thanks, Misra. Really useful. You are a great educator. 🙂

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

    df['q1_num_words'] = df['question1'].apply(lambda row: len(row.split(" ")))
    im getting error -----> AttributeError: 'float' object has no attribute 'split'
    pls help me out

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

      seems like the row you're calling is a float and not a string.

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

      @@misraturp no it's totally a string , actually I solving ml problem quora question pair similarity
      But when I check it showing me ---> Object type
      So what should I do

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

    Great information Misra! Very helpful as I am starting to learn Pandas

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

      That's great to hear Hemant!

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

    Nice job 👏

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

    Hi Misra, thank you for the great explanation. How come you applied data[["salary Range From","Salary Range To']].apply(np.mean, axis=1) with double brackets and you got a series at minute 4:34. You said earlier double brackets will return a dataframe. And wasn't the case here

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

      Hello Avedis, it is because on the dataframe that is generated, I apply a numpy mean (np.mean) function. The result of this mean function is a series object.

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

      @Misra, the point you made in the tutorial was to ilustrate the apply method over a dataframe object and at that point in time you used [[colname]] passing two numeric variables. This is no dought a dataframe object, over which you calculted the average using df.apply(mean).
      Type(df[[colname ]]) is a dataframe class/type

  • @aminul.islam.
    @aminul.islam. Год назад

    Now I've got it well!
    Thanks a lot Misra :)

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

    Thanks for the great content! Keep up the good work please🥰

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

      Thanks for watching!

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

    I like this format, thank you! 🙂

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

    great sharing..Thank you

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

    Excellent, thanks.

  • @e.t.499
    @e.t.499 2 года назад

    practical video

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

    Thanks, 👍👍👍