Basic Guide to Pandas! Tricks, Shortcuts, Must Know Commands! Python for Beginners

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

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

  • @phsopher
    @phsopher 2 ปีที่แล้ว +132

    Python for-loops are very slow so you should avoid them whenever possible. Luckily pandas supports doing math directly on columns. So to add the BMI column you just need
    data['bmi'] = data['height']/data['weight']**2
    For example, for a dataframe with 300000 rows this is over 1000 times faster on my machine than the video's method.

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

      Thank you

    • @АлексейР-ц9х
      @АлексейР-ц9х 2 ปีที่แล้ว +6

      or data['bmi'] = data.weight.div(data.height.pow(2))

    • @PythonSimplified
      @PythonSimplified  2 ปีที่แล้ว +91

      You're absolutely right Phsopher!! 😀
      I totally messed up on this one! it's not just about speed - but also resources! aaaand 5 lines of code that you just reduced into one! 😊
      Thank you so much for your comment and for letting me know - I will film a quick correction tutorial shortly, my apologies for not catching that! (it's funny how I'm instructing folks to avoid for loops in "drop_duplicates()" but encouraging them in data manipulation... 🙃 I can't even use the "brain fart" excuse because of that hahahahaha 🤣🤣🤣)
      Sorry once again - I'll make sure everybody knows there's a MUCH better way! 😉

    • @phsopher
      @phsopher 2 ปีที่แล้ว +14

      @@PythonSimplified No worries :) Thanks for great content!

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

      @@PythonSimplified I wish there was a Code Jam platform that is constantly offering the Best Pythonic Way to do something in real time, where somebody catches the flow of code while in production so it consumes less Brain resources, just like a computer, lol.
      Any ideas ?
      Do you know of any camps that nuture Best practices other than the typical ?
      I would enjoy more live interaction on the code.

  • @amoorinet..
    @amoorinet.. ปีที่แล้ว

    I'm new to programming, but I can swear the way of this explains it works for me perfectly.

  • @charlescollins9119
    @charlescollins9119 2 ปีที่แล้ว +25

    I hope everyone appreciates the amount of time and effort you put into your videos! I know I do! Thank you very much.

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

    Wow! I have no idea what Pythons is, or why I'd want to use it, but I'm going to learn now!!!!

  • @solomononuchefaruna5022
    @solomononuchefaruna5022 10 หลายเดือนก่อน

    I am already in love with you. 😂😂😂😂 You are an incredible and amazing teacher. The smile on your face and your sense of humor makes me want to learn more. I want to be your friend.

  • @BarmitzvahNTC
    @BarmitzvahNTC 9 หลายเดือนก่อน

    I'm new in Python, but with your video I got it so fast and clear.....Thank you so much. Keep the great work on!

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

    Thia was really helpful. I just joined an advanced deep learning course. But I found out i was missing some background.

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

    I Made a app to store my recipes in pdf . But I cannot figure out how to make the recipe save in to a format that I want to create. Really appreciate ❤

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

    I love ur videos. They're well structured with great explanations and are very engaging.

  • @AbdulREHMAN-co2kd
    @AbdulREHMAN-co2kd ปีที่แล้ว +1

    u teach super good keep uploading data science videos in your plaYLIST I LOVE IT

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

    2 minutes into the video I realize we think alike when problem solving. Look forward to exploring your content!

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

    I wouldn’t have bothered with the for loop for the bmi you can calculate the bmi by using: data[“BMI”]=data[“weight”]/data[“height]**2
    Great overview though, enjoy all the videos.

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

    You're the best mentor of all time 🎉

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

    In fact I was working in a project last night, automating an excel file that contains supply levels for Xerox printers, and reading about pandas, great video

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

    You are a very gifted teacher Mariya.

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

    "There you go", another great tutorial ! Thx!

  • @H-yi6jf
    @H-yi6jf ปีที่แล้ว

    Hi Mariya,
    This video helped me with creating a budgeting app for an assignment in a programming course. Pandas was used in my app for outputting tables of expense data. Thank you for posting videos.
    - Henry

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

    Mariya, have you looked into the Polars library for Python? It's supposed to be much faster than Pandas? It might be helpful to do a comparison video on Pandas vs Polars - strengths and weaknesses. What do you think?

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

    You sold me on learning pandas.
    Looks like a great alternative to ETL tools like informatica.
    I'll learn it well.

  • @yashtewani231
    @yashtewani231 11 หลายเดือนก่อน

    @10:13 if you can't remove the index column, The issue might be the default behavior of read_csv when reading from a file with a custom separator (in this case, \t).
    The first column name is being interpreted as the index column.
    To resolve this, you can explicitly set the index column in select_DF file. Adjust line 2 like this: data=pd.read_csv("bmi.csv", sep="\t", index_col=0)

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

    Great! Thank you!

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

    Thanx and highly appreciate ❤
    Create more content about ML and DL

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

    Awesome!!
    I liked this video and the girl as well. She speaks and move hands as my MSc supervisor.

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

    Love the pandas tutorials! Thank you from bitterly cold Ontario, I hope you're keeping warm.

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

    This is the tutorial I was after for some time. Thanks a million. Fantastic presentation (as always)

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

    Love the Stich pullover!

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

    Thank you Mariya. Your tutorials are really simplified and awesome!!!

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

    Thanks for the tutorial. What terminal program are you using? Looks handy.

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

      It's a cloud IDE called Wayscript: www.wayscript.com/
      Made by a bunch of really nice folks who were supporting this channel from the very beginning 😀
      Also, Scott4WhiteRock as in White Rock, BC? We're almost neighbors! 😁
      Cheers from Burnaby!

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

    Excellent! Clear, efficient, simple and well explained and demonstrated.

  • @barunchowdhury87
    @barunchowdhury87 9 หลายเดือนก่อน

    Mam pls tell which keyboard u use? Keyboard sound is awesome..

  • @JoseLuis-zx2lp
    @JoseLuis-zx2lp 2 ปีที่แล้ว

    And there you go, this is how a magnificent video is made. Thanks for so much all tricks.

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

    Your content is gold.

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

    Wow you are a hero, you saved my project. Thank you so much!

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

    This is such a great video thank you. I have been getting up to speed on pandas the past few days and this is one of the best I've seen. Thank you!

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

      Thank you so much Charlie! 😀
      I have one correction to the code I presented in this tutorial, it should have been:
      data["bmi"] = data["weight"]/(data["height"]**2)
      This saves typing, doesn't waste resources and runs much faster! (especially when dealing with enormous amounts of data)

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

    I didn't know that you can do querys in a database with pandas! Super-mega-ultra-useful jajaja Gracias jefa

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

    just what i was looking for!!!

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

    Great video! Now I have a quesiton, when I run the line 25 at time stamp 10:26, it was report "read_csv() got an unexpected keyword argument 'index'", could you please tell me how to fix it? Thank you very much!

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

    Great tutorial
    I like the sound made by your keyboard when u were typing. It sound great too.

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

    Your for loop really helped me with some things that I couldn't do with standard pandas calculations! Thanks! Great video!

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

    What's this light projector device? It's awesome.

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

    adding rows also can be done via pd.Series and passing a list

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

    Your content is amazing. I really enjoy your channel.

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

    really nice explaination.....when i was new to programming i write a code in 3 days to group the dataframe by using index and lists, after 3-4 months i came to know that pandas have inbuilt "groupby" 🤦 sometime i still laugh for what i did🤣

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

      hahaha I totally understand! I had the exact same situation with the pd.read_html() method!! 😁
      I have a 20 minute long video showing how to web scrape a Wikipedia table with Mechanical Soup:
      th-cam.com/video/MkGQmZoMuRM/w-d-xo.html
      And then in one of the comments, somebody mentioned read_html()... took me less than 5 minutes to get the exact same results!!! hahahaha 🤣🤣🤣
      But the good news is - you'll never forget "groupby" just as much as I won't forget "read_html" 😜

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

      @@PythonSimplified yeah true😅😝

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

      An excellent way to remember- self taught might make mistakes in the beginning, but become some of the most well thought out for programmers.

  • @esayastekleweyni5353
    @esayastekleweyni5353 5 วันที่ผ่านมา

    you are absolute genius

  • @Conceptcenter-ut4yi
    @Conceptcenter-ut4yi 5 หลายเดือนก่อน

    Thank you mariya for your lecture it was really helpful

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

    Thanks , there is a lot of good information in this video!!

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

      Thank you so much! I'm glad you found it useful! 😀😀😀

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

    How am I just discovering you?! This is glorious!

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

    Thank you for all the details in this video.
    Jumping to the previous video and codes (GTA stuff) was confusing, but "pandas" material was awesome!

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

    Great video, Mariya. Keep up the great work!!

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

    Doing something like data.iloc[1]["weight"] is inefficient and requires accessing the frame twice - the first access extracts a series at index 1 and the second one retrieves the value at the 'weight' index from the series. Instead, one should try to always use the multidim accessors, that is .iloc[*, *] or .loc[*, *]. There are also accessors - .ix[*, *] - that mix the integer-based acces with with the column-name based access but these should be used with extreme caution and are in fact deprecated.

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

    Really cool tricks Mariya.
    Especially the bot removing trick for code-jam, that really got me... Great work...

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

    What a great explanation!!! Thxxx!

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

    I learned a couple of tricks, that's good. I believe the documentation does not recommend iteration on data frames. You're better off to use the apply, map etc functions which I use regularly. They're quick and efficient compared to iteration, especially if you're dealing with million plus lines of data.

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

      You're absolutely right Philip! 😀
      The method I've shown is not only taking up waaay too many lines of code - but its also time costly and wastes lots of resources!
      It should have been:
      data["bmi"] = data["weight"]/(data["height"]**2)
      instead of the unnecessary for loop, the appending and all that jazz 😟
      My apologies on the mess-up, I will film a short correction video very soon!
      And thank you so much for your comment! I really appreciate you letting me know! 😊

  • @Евгений-ф8н2э
    @Евгений-ф8н2э 2 ปีที่แล้ว

    Mariya, I I really thank you for your tutorials!

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

    Binge watching your channel today getting solutions for my TODO list on my current project. (Refactor and Mobile version of my Clownfish Genetics Calculator) Now, I'll be able to refactor my results phenotype data with Pandas. It's current a nasty spaghetti if statement...uggh! Thoroughly enjoying your channel and learning a lot (more kivyMD and adb)!

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

    Just adding my own appreciation for a well architected video, and well done too for taking on the suggestion of others for improving the code.❤

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

    This is dope am digging these pandas 🐼

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

    Thank u.......The reason I am thanking is ,hitherto I am confused by the result which given by the Python is error, while I doing dataframe work .......because I don't know before watching this video It is important to put dataframe D and F in caps😁😁😁

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

    now i love pandas :)

  • @davidescobar7170
    @davidescobar7170 6 หลายเดือนก่อน

    hi! thanks for the video

  • @mitaly_Onlineshop
    @mitaly_Onlineshop 11 หลายเดือนก่อน

    Thank you so much for caring and teaching python which is so sweet , you are so professional and affable.I'm following your youtube channel and telling my friends to follow you, Good Luck :)

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

    hello belle, thanks for all good information you shared with us. I am a new python learner and i would like to know how or the best way to extract data from a pdf file that has inside date, numbers and letters. i would like to see how we can sort them and delete what we don't need. if it is possible . thanks

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

    you are the best!!! , great job. Thank you.

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

    Great video. Makes me appreciate R so much more.

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

    Amazing tutorial as usual. Thanks again Mariya

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

    Trying to think of a use case with pandas for my Open World Text Adventure lol. Not sure if I'd benefit from it or not since I don't need to know what data exists and where, nor do I need to see it printed out (it's printed but in a more user-friendly way). But I still enjoyed watching this tutorial and will try some things out in the future!
    Right now I just use for loops to detect what the game is asking for in the player inventory either by selection (viewing the inventory and highlighting the item with the arrow keys) or by action (like trying to mine for Iron, we know we need a pickaxe so a for loop will check for one equipped). I want to see if pandas has anything interesting I can do with my inventory dictionaries, but like I said I have no need to know what is where or how many the player has, it is just handled with my functions and for loops.

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

    I must learn a absolutelly basic of computer programming first. I will be back 45 yrs later. Cheers.👽

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

      hahahahaha trust me, it's not gonna take you 45 years if you watch my channel 😜
      Checkout this vlog of mine when I talk about the roadmap of learning Python:
      th-cam.com/video/wFEC7VbWBZo/w-d-xo.html
      I have so many videos explaining these concepts, but you can always take a quick "introduction to Python" course in an online platform like Udacity, Udemy, Idx, Coursera first. They often offer free introduction courses and it's a really quick way of getting up to speed with Python 😊
      Best of luck on your programming journey - it's the most exciting profession in the world, you gonna love it! 😁

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

      Not nearly that difficult. Learn how to get the computer to print to screen, then how to get text from keyboard, then learn conditional statements

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

    The queen is back

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

    Love your videos. Well presented and clear. Thanks for taking the time to make this.

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

    This was a brilliant tutorial, but how would I make this into a data display board?

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

    pandas is love thanks Mariya

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

    A quick tip for the face cam video problems ... record both on seprately . record the screen as you do and record your facecam with a seprate camera or use a seprate recorder for the facecma

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

    This was a helpful tutorial, thanks.

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

    Well explained 👌🏿. What do you use to make your videos?

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

    Great stuff.
    One question though:
    what is faster: filtering data from db with pandas/python of just sql command select XXX where xxxx ?

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

    There you go M !! always amazing !!!

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

    Great video with details. I would suggest you to make the same kind of videos about Numpy, matplotlib and other visualisation libraries. Also SQL)

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

      Thank you so much Rashid!
      Will do! both Numpy and Matplotlib are definitley on my list! 😉

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

    Great video, thanks... fun examples and attitude made it quite interesting throughout in a way that many tech tutorials are not, and paced at what I thought was exactly the right speed..

  • @Dev-Phantom
    @Dev-Phantom 2 ปีที่แล้ว

    very insight full .....i love this

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

    Thank you!
    Very nice video, and since I got to see this video I also checked your channel.... I subscribed
    Keep up the good work! :)

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

    ur amazing always , can u do any video on stock market data manipulation using pandas and numpy ?

  • @ikeu6433
    @ikeu6433 11 หลายเดือนก่อน

    Every time you click your keyboard, and my ears are devastated by the thunderous roar coming through my headphones I am traumatized 😢
    Great video otherwise. I’m glad these resources are freely available. Thank you for your contribution to the coding community 😊

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

    Nice video. This is the kind of guide that is handy in almost every situation with pandas. I've learned new tricks. Thanks you.

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

    Nice video. I am new to Pandas and this video has thought me a lot. Thanks!

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

    Great video. Congrats for your channel

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

    You have a gift for explain, thank you, I would love to know about pandas and data analytics

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

    Pandas is the best money making library I’ve seen so far.

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

    Hola, great job!.. thank you.
    I recommend learn typing (mechanography). Bye!

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

    This is a great video! I use excel a lot, but I am trying to use Python more so I can work with larger sets of data :) Thanks for the great tutorial!

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

    Hey Maria, amazing job! very nice video..just a feedback the audio is out of sync with your lip movements

  • @hand-eye4517
    @hand-eye4517 2 ปีที่แล้ว +1

    Thank you , for all the useful and informative content.

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

      Thank you so much for your lovely comment! 😃

  • @KARYEIJAFELEX
    @KARYEIJAFELEX 3 หลายเดือนก่อน

    Thank you Mariya, i now who what iloc is😁

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

    Nice video.
    But I couldn't find any solution about how to convert values in one column (DataFrame has loaded by read_csv) from string to DateTime type.
    Спасибо!

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

    Hey i would like some help with a question about my assignment using python with pandas

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

    awesome shirt haha

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

    Thank you. Good pace and really friendly 👌

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

    Can you explain if you need to save data to excel file?

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

      Good question. You can try mine and check the playlist for Python. Very easy to follow fundamental tutorials for Python. And source files can be downloaded. Another playlist in the channel is R Beginning course.

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

    Your Stitch t-shirt is awesome! :D

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

    I like so much your explanation. Thank you for the information :D.

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

      Thank you so much for the lovely comment Axel! 😃

  • @k.ballajiaxe6403
    @k.ballajiaxe6403 2 ปีที่แล้ว +1

    thanks it's very useful for us :) love you

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

      Thank you so much!! super happy to hear! 😁