Python Pandas Tutorial: Pandas Apply Function and Vectorization #15

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • In this video we are going to discuss about Pandas apply function in greater details. Applying a function to all rows in Pandas DataFrame is one of the most common operations for cleaning and unifying messy and complex data sets for easy access and analysis.
    This video tutorial will cover complete understanding of below points:
    1.) What is Pandas Apply function?
    2.) How to use Pandas Apply function?
    3.) How to use apply function on pandas series?
    4.) Use loc with Pandas apply function
    5.) How to create sales bucket using user define function with Pandas apply function?
    6.) Use apply function with lambda (anonymous function).
    7.) Why Pandas apply function works slow on large data set?
    8.) How to use vectorization for fast execution on large data set?
    9.) Calculate the execution time between pandas apply and vectorization.
    10.) More...
    Python Teaser: • A Beautiful Python Pro...
    Python Pandas Tutorial: • Python Pandas Tutorial...
    Python Playlist: • Python Tutorial for Be...
    Python Data Structure Playlist: • Python Data Structure
    Python OOPs Playlist: • Object Oriented Progra...
    Python Excel Automation: • Excel Automation Using...

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

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

    Dataset : github.com/AbhisheakSaraswat/RawData

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

    Sir when we passes calcSales fun in lambda expression what is x[total sale amount] and how it x is referring to df column at 6:47

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

      Hi Aklesh, using the lambda function we are applying the calcSales function on dataframe right, so x is lambda variable by which we are accessing the dataframe columns "Total Sale Amount". for more info watch lambda tutorial it will help you.
      th-cam.com/video/faVjlTxaR4U/w-d-xo.html

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

      @@ProgrammingIsFunn thank u sir ,comment is self explaining !!

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

    Hi Sir I am beginner in python programming can you guide me where I will start from. Sir if you provide a class please let me know.

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

      Follow this playlist for Python from very beginner
      th-cam.com/play/PLWuFHho1zKhWb-f-SJAMUCK--f8PJlG46.html

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

    3:10 doesn't make sense, so are you getting the max price for that customer or overall? wouldnt max(df.Quantity) give you the max quantity of the entire DataFrame, not just for this customer? .. why was only 1 customer record shown for Willie Oliver, I don't understand that part?
    wouldnt df.loc[:,"Customer","Total Sales Amount"].apply(max,axis=rows) give all records and the max values for each record ? , a bit confused

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

      Hi tobedeleted, here we are getting the max price for overall customer in DataFrame. So, we will have only single customer against the max quantity and sales.