Python Pandas Tutorial 10. Pivot table

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ต.ค. 2024

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

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

    Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced

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

    Step by step guide on how to learn data science for free: th-cam.com/video/Vn_mmOuQkSA/w-d-xo.html
    Machine learning tutorials with exercises:
    th-cam.com/video/gmvvaobm7eQ/w-d-xo.html

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

    Sir, You are amazing! I am really happy today I am able to perform these tasks today in pandas. I am really happy for that. Kudos Sir, what ever you are doing is really service to this human society. This is really super altruistic nature.

  • @paintingmylifeawaify
    @paintingmylifeawaify 7 ปีที่แล้ว +10

    Great, great tutorial! You explain everything so wonderfully and clearly. Thank you!

  • @isaacnewton7445
    @isaacnewton7445 6 ปีที่แล้ว +9

    omg these vids are perfect for what I'm doing at my work. Exactly the kind of pandas info I was looking for. Thank you.

    • @timothypulliam2177
      @timothypulliam2177 4 ปีที่แล้ว +5

      Thank you for Gravity Sir Isaac Newton

    • @RockStar-pw5wd
      @RockStar-pw5wd 4 ปีที่แล้ว

      @@timothypulliam2177 😂😂😂

  • @Osama-xs8cl
    @Osama-xs8cl 7 ปีที่แล้ว +23

    you r awesome man keep going your learning style is very interactive , come with new lessons

    • @hpourmamih
      @hpourmamih 4 ปีที่แล้ว

      He is AMAZING!!!!

  • @shaikansari6882
    @shaikansari6882 6 ปีที่แล้ว +5

    You are awesome man. You explain everything so clearly. Thank you so much

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

    This is an awesome video--totally on spot for what I am learning in coding bootcamp

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      Judy, I appreciate you leaving a comment of appreciation

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

    Best tutorials, clear and concise! Well done! Thank you so much!

  • @prasantakarmakar8554
    @prasantakarmakar8554 4 ปีที่แล้ว

    Very Sorted Educative video. within this short time I learned Pivot which I was not able to get From last week. Thanks a lot. Require Video on Pivot using If-Else in Python and CrossTab.

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

    Sir, your tutorials are very useful :)
    They are easy to understand, thanks for your help Sir.

  • @BiancaAguglia
    @BiancaAguglia 5 ปีที่แล้ว +6

    Thank you. This helped a lot.

    • @codebasics
      @codebasics  5 ปีที่แล้ว

      Glad you found it useful Bianca. 😀

  • @Forever._.curious..
    @Forever._.curious.. 2 ปีที่แล้ว

    Thankyou so much , for yr work I love it 💝

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

    It was a very good explanation. Thank you so much!

  • @abhishekranjan2617
    @abhishekranjan2617 3 ปีที่แล้ว

    superb video, I love this video.....👌👌👌☺☺☺🙏🙏😍🥰

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

      Glad it was helpful!

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

    great explanation, thank you so much. stay safe

  • @SauravKumar-xg4zr
    @SauravKumar-xg4zr ปีที่แล้ว

    You gain a subscriber and a like :) Thanks for sharing this!

  • @dr.k.gayathrideviprofessor5297
    @dr.k.gayathrideviprofessor5297 4 ปีที่แล้ว

    Very Informative Session.

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

    Good explanation....

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

    Great video, thanks for sharing!

  • @hugolousa
    @hugolousa 4 ปีที่แล้ว

    Thanks for great quality class!

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      You're very welcome!

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

    Excellent video! Thank you!

  • @ishandaar
    @ishandaar 4 ปีที่แล้ว

    you are awesome man you helped me learn a new thing today

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

    Awesome tutorial in very easy way.

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

    God bless you and ur family

  • @chitrajain5059
    @chitrajain5059 6 ปีที่แล้ว

    Your tutorials are great.It will be great if you can give some assignment at the end of every tutorial. And also some small projects where we can apply our learning. Thank you code basics.

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

    Great video -- very clear and concise, thanks!

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

    Thanks for your Video !
    Can you please let me know if we can put those collapse and expand functionality in actually generated pivot table in excel using python ??

  • @Kitaplayolculuk
    @Kitaplayolculuk 4 ปีที่แล้ว

    Again very good lesson ,thank you

  • @shrikant301991
    @shrikant301991 5 ปีที่แล้ว

    Great tutorials ..please upload more videos on Python along with it's applications

    • @codebasics
      @codebasics  5 ปีที่แล้ว

      sure. I just started a deep learning tutorial series with python today with first introduction tutorial. check it out on my channel.

  • @AndrewDavidson-un2df
    @AndrewDavidson-un2df ปีที่แล้ว

    great video. your examples are very helpful

  • @CA_Sandeep_Modi
    @CA_Sandeep_Modi 5 ปีที่แล้ว

    you r awesome man keep going your learning style is very interactive , come with new lessons and advance pandas

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

      👍👍🙏😊

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

    Just loved it. Thank you.

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

    @codebasics, At time 2:49 in some rows it is showing "none" and in some it is "NAN". Kindly explain.

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

    you are an angel:) thank you so much

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

    Hey, Nice tutorial.
    Why don;t you use the command : shift+tab, for the documentation by clicking and pressing that command on that specific function?

  • @wanfaris9473
    @wanfaris9473 4 ปีที่แล้ว

    Thank you sir! very helpful !

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

    this really helped me thank you very much :)

    • @codebasics
      @codebasics  3 ปีที่แล้ว

      I am happy this was helpful to you.

  • @anthonymclaughlin9222
    @anthonymclaughlin9222 3 ปีที่แล้ว

    Thanks for the lesson! Really helpful!

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

    How would it work if I have a df with two columns, id and value. I have two values per id and I want to pivot to end up with a new dataframe that is id, value1, value2?

  • @neil007sal
    @neil007sal 3 ปีที่แล้ว

    In this video, you said x axis is city at 0.41 but it actually looks like Y axis..and date as X axis.. correct me if I am wrong

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

    Hello , very nice video , so how to replace NaN values to my new york column at 2:24 dealing with the SettingCopyWarning ?

  • @deepakjaju1549
    @deepakjaju1549 3 ปีที่แล้ว

    You are No1.Super Duper

  • @HawkingMerchant
    @HawkingMerchant 4 ปีที่แล้ว

    sirf you creates the best content available but i know python learning data science to get a job also giving time to java programming
    will it be able to get a job without a degree

  • @MinhVu-bl4ss
    @MinhVu-bl4ss 6 ปีที่แล้ว +1

    It's very helpful thank you

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

    you make things look easier........

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

    Great teacher! Tks

  • @hemendrapratapsingh4219
    @hemendrapratapsingh4219 7 ปีที่แล้ว

    How do I write in to existing csv/excel file by adding new column?
    i.e., If I have a data in one column (column A) and want to add one column with conditional formula which will show "Yes/No" against all the values of Column A in new Column B, how can we do it?
    e.g. I have one column A containing the Talk time (in secs) of people. In new column B, I want to put "Yes/No" based on the condition that if Talk time is less than 30 sec its "Yes" else "No". How can I do that?

  • @yashchhabra9185
    @yashchhabra9185 5 ปีที่แล้ว

    Can you please tell me how to use the mode function in the aggfunc. I have a categorical data set , i tried this
    ''''''outlet_size_mode = train.pivot_table(values='Outlet_Size', columns='Outlet_Type',aggfunc=(lambda x:mode(x).mode[0]) )'''''' , below error is coming , error : '

  • @sparc373
    @sparc373 6 ปีที่แล้ว

    Thanks for sharing this, can you tell me if there is any limit for number of lines or size of data to be processed.

  • @TanvirAhmed-em7iv
    @TanvirAhmed-em7iv 4 ปีที่แล้ว

    index contains duplicate entries,cannot reshape........How to fix this problem?

  • @engineerbaaniya4846
    @engineerbaaniya4846 4 ปีที่แล้ว

    love u sir ji you made our day

  • @nandanavarevinod4684
    @nandanavarevinod4684 3 ปีที่แล้ว

    liked for your voiceover

  • @navjotmannan7303
    @navjotmannan7303 5 ปีที่แล้ว

    Can you pls suggest, what is the use case of pivot in pandas, when u can use excel or tableau? If the dataset is huge, anyways we won't be able to see the entire ouput in Jupyter Notebook?

    • @codebasics
      @codebasics  5 ปีที่แล้ว

      pandas can handle much more larger datasets then excel. Excel has limit on how many rows it can handle whereas pandas can handle millions of rows seamlessly. In terms of visualization also jupyters next gen version jupyter lab has come out which can handle rendering of many many rows very efficiently. I will add a tutorial on that in future.

  • @Asparuh.Emilov
    @Asparuh.Emilov 3 ปีที่แล้ว

    That’s great! But what if I want to add a calculated field or calculated item to my pivot?

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

    Great sir awesome

  • @jasonhu7399
    @jasonhu7399 5 ปีที่แล้ว

    I have a question: why can't we use city as index for the first dataframe?

  • @rajatpati9099
    @rajatpati9099 5 ปีที่แล้ว

    df5 = pd.read_csv("weather3.csv")
    df5
    df['date'] = pd.to_datetime(df['date'])
    display(df[['date']],df5)
    df6 = df5.pivot_table(index=pd.Grouper(freq='M',key='date'),columns='city')
    I am getting TypeError: Only valid with DatetimeIndex, TimedeltaIndex or PeriodIndex, but got an instance of 'Index'

  • @PatelMahendra
    @PatelMahendra 4 ปีที่แล้ว

    @codebasics How to remove those unnecessary headers from pivot?

  • @MrPrudhvisai
    @MrPrudhvisai 4 ปีที่แล้ว

    can calculate the average of humidity,temperature with respective to the city using groupby function. just like at 4:16

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

    Thank you sir.

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

    Thank you so much sir

  • @reshaknarayan3944
    @reshaknarayan3944 4 ปีที่แล้ว

    Very useful.

  • @TheStainlessFish
    @TheStainlessFish 4 ปีที่แล้ว

    at 0:33 you say x axis dates and y is city!! shouldnt it be the opposite? please explain

  • @fengqingchu8399
    @fengqingchu8399 5 ปีที่แล้ว

    hi, there is no aggfunc parameter in the current version of pandas?

  • @ishanchourey2252
    @ishanchourey2252 5 ปีที่แล้ว

    hey. If I want to perform a roll-up function on my dataframe, how should i go about it

  • @harishanmugam89
    @harishanmugam89 5 ปีที่แล้ว

    I have a data in excel with 20 columns. I need to show the required data with 5 columns in Graphical or pie chart format. Can you help in getting that done??

    • @harishanmugam89
      @harishanmugam89 5 ปีที่แล้ว

      @@codebasics thank you will check and get back

  • @saurabhtiwari5525
    @saurabhtiwari5525 3 ปีที่แล้ว

    Can we add multiple columns there ?

  • @vishavgupta3717
    @vishavgupta3717 4 ปีที่แล้ว

    Please answer as soon as possible.I want your help.How to append pandas dataframe below an existing Excel file with the help of any library other than openpyxl. I have used openpyxl but openpyxl removes pivot table from my excel sheet. Please provide me code .How to achieve it?

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      can you try this? stackoverflow.com/questions/38074678/append-existing-excel-sheet-with-new-dataframe-using-python-pandas#38075046

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

    Thank you so much for sharing his video sir. Everyone understood easily sir. If you please share weather datasets through mail sir.

  • @ojhaashirbad
    @ojhaashirbad 4 ปีที่แล้ว

    Hello bro, thanks all for your good work. Could you please tell me hot to export the entire pivot data into excel workbook including Indexing?

  • @sovravi
    @sovravi 7 ปีที่แล้ว

    How can I get output in as decimal rather it giving as floating numbers?

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

    how to sort the cross tabs rows and column alphabetically?

  • @spicytuna08
    @spicytuna08 5 ปีที่แล้ว

    awesome examples

  • @dhananjaykansal8097
    @dhananjaykansal8097 5 ปีที่แล้ว

    When you print your DataFrame you get borders around your data. I don't get it. Sir can you please tell me why? Or anyone would like to answer....Hope I was able to explain my question well.

    • @codebasics
      @codebasics  5 ปีที่แล้ว

      That's due to Jupiter version. Just download latest anaconda and you should be good.

    • @dhananjaykansal8097
      @dhananjaykansal8097 5 ปีที่แล้ว

      @@codebasics I'll try again because I've the latest one only. I'm running on Mac

  • @akshaybanaye
    @akshaybanaye 4 ปีที่แล้ว

    pivot command gave an error: Index contains duplicate entries. Can not reshape."

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

    awesome tut.

  • @benjamincabalona9014
    @benjamincabalona9014 6 ปีที่แล้ว

    Hi man, thank you. I'm a new data analyst. We mostly use googlesheet, but i wanna know if there is a way i can use a calculated field in python pandas?

    • @benjamincabalona9014
      @benjamincabalona9014 6 ปีที่แล้ว

      @@codebasics Hi! Im really glad i found your channel. I also started your machine learning course.
      pd.pivot_table( index=["date_pst","type"],values=["cost","purchase"], aggfunc='sum')
      i wanted to add another column like cost/purchase.

    • @benjamincabalona9014
      @benjamincabalona9014 6 ปีที่แล้ว

      @@codebasics Nevermind, i have found the answer on stack excange. Thanks again!

  • @mohammed333suliman
    @mohammed333suliman 5 ปีที่แล้ว

    Helpful, thank you

  • @virgilioespina
    @virgilioespina 5 ปีที่แล้ว

    Can you do the reverse? columns to rows?

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

    Hi Sir, im interested to learn python and related modules for data science or data analyst

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

    Good Video

  • @anuradhasrivastav9038
    @anuradhasrivastav9038 4 ปีที่แล้ว

    How can I install pandas in python 3.8
    Please guide

  • @yogeswarasarat5950
    @yogeswarasarat5950 5 ปีที่แล้ว

    I am getting this error while trying to reshape my dataset.
    "ValueError: Index contains duplicate entries, cannot reshape"
    NOTE: I have null values in my dataset. Is that a problem?

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

      Try pd.pivot_table(df, index = ['ABC'], columns = ['DEF'], values = ['GHI'])

    • @akshaybanaye
      @akshaybanaye 4 ปีที่แล้ว

      @@miaomiao2454 Thanks. But can you explain why this error occurred?

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

      Akshay Banaye df.pivot_table is a generalization of df.pivot, which can handle duplicate values for one pivoted index/column pair.

  • @David-lb1jx
    @David-lb1jx 2 ปีที่แล้ว

    Thank you sir

  • @umakantaparida6719
    @umakantaparida6719 4 ปีที่แล้ว

    how to dowload the csv file from github i can't find out from the description
    please help anyone

  • @ROHIT-gv7xk
    @ROHIT-gv7xk 4 ปีที่แล้ว

    very nice

  • @banduriambrish5092
    @banduriambrish5092 3 ปีที่แล้ว

    Help me how to save pivot templet from python to csv

  • @danielspector9280
    @danielspector9280 3 ปีที่แล้ว

    thank you man

  • @optimus7801
    @optimus7801 5 ปีที่แล้ว

    Error?
    Index contains duplicate entries,can't reshape
    Please Help!

    • @optimus7801
      @optimus7801 5 ปีที่แล้ว

      @@codebasics Yes exactly it is the same

    • @optimus7801
      @optimus7801 5 ปีที่แล้ว

      @@codebasics Thanx

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

    so good

  • @denisbaranoff
    @denisbaranoff 5 ปีที่แล้ว

    Helpful!

    • @codebasics
      @codebasics  5 ปีที่แล้ว

      Glad you liked it Dennis

  • @rekhachander9985
    @rekhachander9985 3 ปีที่แล้ว

    How can i download the CSV file?

  • @robertnelson9621
    @robertnelson9621 4 ปีที่แล้ว

    pivot_table : pandas.core.base.DataError: No numeric types to aggregate

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

    although you have very strong accent i can clearly understand everything you told. Thanx !

    • @codebasics
      @codebasics  4 ปีที่แล้ว

      Glad I could help!

  • @atharvnikhare7113
    @atharvnikhare7113 4 ปีที่แล้ว

    Not able to access the code file on github. Fix it and reply.

  • @patricechaula3430
    @patricechaula3430 3 ปีที่แล้ว

    Thank you

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

    thanks sir

  • @abhishekpanjiyar8266
    @abhishekpanjiyar8266 3 ปีที่แล้ว

    i thank you sir

  • @zes7215
    @zes7215 6 ปีที่แล้ว

    not ax or not, do/can do any nmw