Python Pandas Tutorial (Part 5): Updating Rows and Columns – Modifying Data Within DataFrames




[ad_1]

In this video, we will be learning how to update the values in our rows and columns.

This video is sponsored by Brilliant. Go to https://brilliant.org/cms to sign up for free. Be one of the first 200 people to sign up with this link and get 20% off your premium subscription.

In this Python Programming video, we will be learning how to modify the data within our DataFrames. We will use some of the filtering techniques we learned in the last video to update values conditionally, and we will also be learning how to use the apply, map, and applymap method. Let’s get started…

The code for this video can be found at:
http://bit.ly/Pandas-05

StackOverflow Survey Download Page – http://bit.ly/SO-Survey-Download

✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms

✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY

✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey’s Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/shop/coreyschafer

▶️ You Can Find Me On:
My Website – http://coreyms.com/
My Second Channel – https://www.youtube.com/c/coreymschafer
Facebook – https://www.facebook.com/CoreyMSchafer
Twitter – https://twitter.com/CoreyMSchafer
Instagram – https://www.instagram.com/coreymschafer/

#Python #Pandas

Source


[ad_2]

Comment List

  • Corey Schafer
    December 2, 2020

    Hey everyone! I hope everyone finds this video helpful. I wanted to make this video shorter, but I really wanted to highlight all the different ways we can update our rows and cover the apply, map, and applymap methods in as much detail as I could. In the next video, we'll be learning how to add and remove rows/columns. It will be much shorter. I should have that video out next week. I hope you all have a great weekend!

  • Corey Schafer
    December 2, 2020

    As I am using 'replace' and 'map' function are showing same result

  • Corey Schafer
    December 2, 2020

    I am your chinese audiant ,i feel your video is really helpful! i am now study at singapore management university !!!!business analytics major, so use python to do data analytics is really important ,and your video is focus on use python to deal data!

  • Corey Schafer
    December 2, 2020

    After all these tutorials I want to know who is John Doe…

  • Corey Schafer
    December 2, 2020

    I was curious so I looked it up:
    at is faster than loc but only works on individual cells. loc can work with arrays of cells

  • Corey Schafer
    December 2, 2020

    Every single video you do is perfect. Pacing, structure, content.. everything.

  • Corey Schafer
    December 2, 2020

    Thank you so much Corey for these videos

  • Corey Schafer
    December 2, 2020

    Applymap and apply not working on the stackvoerflow data frame? Why?

  • Corey Schafer
    December 2, 2020

    I can't believe I am watching this for free. I admire people like you, Corey Schafer. Thanks a lot!

  • Corey Schafer
    December 2, 2020

    When i try to changed a value in columns,
    it loses all values ​​and
    changes to 'None'. I created a variable for the column, took the values I didn't want from it and tried to "import" it again to the df. could someone help because it returns 'None' ?

  • Corey Schafer
    December 2, 2020

    Super explained, it is easy to understand for DB developers. Thanks

  • Corey Schafer
    December 2, 2020
  • Corey Schafer
    December 2, 2020

    25:00 rows and columns are same 3X3. I tired same. but for df.apply(len, axis = 'rows') the columns are getting calculated. Am i missing something here?

  • Corey Schafer
    December 2, 2020

    Hi corey, could you please make separate videos for reshaping the DataFrame like pandas.melt(), pandas.pivot() with groupby(). It's really helpful to solve the structural issues of the DataFrame and make correct DataFrame for the analysis and visualization. Thank you very much! 🙂

  • Corey Schafer
    December 2, 2020

    Hey Corey!! Thanks for the amazing series on Pandas 🙂 It's the best sequential and easy to follow series I have come across.

  • Corey Schafer
    December 2, 2020

    Thank you so much

  • Corey Schafer
    December 2, 2020

    I didnt understand why we didnt put function parenthesis in apply() @ 20:50.

  • Corey Schafer
    December 2, 2020

    df.apply(len, axis='columns'); why does this count the elements in a row, shouldn't this be counting the number of elements in a column.

  • Corey Schafer
    December 2, 2020

    I was Trying to use the apply(len) on the stackoverflow df but it is not working says that object of type float has no len()..?? can anyone help

  • Corey Schafer
    December 2, 2020

    My recasting of Yes/No for Hobbyist turned into NaN values. Not sure how this happened

  • Corey Schafer
    December 2, 2020

    I wonder what inspires you as a person. Can you host a QnA or AMA ? We all have tons and tons of funny and serious questions to ask

  • Corey Schafer
    December 2, 2020

    You are incredible. You explain very well and simple. Thank you a lot. From Argentina

  • Corey Schafer
    December 2, 2020

    Sometimes we just pass in the function name without the parentheses (i.e. we are not calling it). Why do we do so? Is there some succint, beginner friendly answer?

  • Corey Schafer
    December 2, 2020

    She: Let's do it tonight
    Corey: Well, there's a couple of different ways that we could do this 🙂
    Btw, Thanks Corey for your effort. These tutorials are gold 🙂

  • Corey Schafer
    December 2, 2020

    Why would we use map vs replace? I understand that map converts things to NaN if we don't specify, but don't understand why use one vs the other.

  • Corey Schafer
    December 2, 2020

    Why len email =23 or 17? When I count the characters, len is less.

  • Corey Schafer
    December 2, 2020

    Your videos are very helpful !! Please post a tutorial on using loops in pandas data frames….thanks much !!

  • Corey Schafer
    December 2, 2020

    A video about some scikit learn algorithms?
    It would be great, beautiful, unique … xD

  • Corey Schafer
    December 2, 2020

    If someone is having doubt that they should watch these video or not I would suggest just see like to dislike ratio. 1.5K likes and 7 dislike. Such a good ratio is not anywhere else on youtube. Thanks Corey :).

  • Corey Schafer
    December 2, 2020

    🤣🤣 6:00, inplace equals True will make that change go through!

  • Corey Schafer
    December 2, 2020

    df.at is faster than df.loc ..

  • Corey Schafer
    December 2, 2020

    Thankyou

  • Corey Schafer
    December 2, 2020

    Can you please show me how to group by multiple columns and update a value of the column in the grouped rows

  • Corey Schafer
    December 2, 2020

    ekdam badhiya batawa taaresh bhai , chal badhiya baa

  • Corey Schafer
    December 2, 2020

    Simply superb Corey. Thanks a lot. You are a good teacher. Can you please upload a video on lambda functions and numpy series, it will be really great.

Write a comment