Python Pandas Tutorial (Part 3): Indexes - How to Set, Reset, and Use Indexes

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

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

  • @coreyms
    @coreyms  4 года назад +114

    Hey everybody. I hope everyone's week is starting off well. I'm still working on the next video in the series, so I don't have a specific release date just yet. Just keep your eyes open. I'm hoping to have this entire series finished soon, but I'm not sure how long it will take me to record/edit the remaining video. I'll do my best to get them out ASAP (this week or next). Have a good one!

    • @prakharthapak4229
      @prakharthapak4229 4 года назад +2

      Hi Corey, can you please do tutorials on pytorch ? That would be so useful.

    • @alanbarzilay6866
      @alanbarzilay6866 4 года назад +2

      Hi, have you seen the release of pandas 1.0?pandas.pydata.org/pandas-docs/version/1.0.0/whatsnew/v1.0.0.html
      Is this going to affect this series in any way?
      Also thank your for all of your work! You do an incredible job!

    • @SHUBHITTALUSBIS
      @SHUBHITTALUSBIS 4 года назад

      Sir how many videos are in this series?

    • @waynezor
      @waynezor 4 года назад

      @@alanbarzilay6866 It's still a release candidate, so probably not. However, everything here could at some point become obsolete for sure.
      The documentation on pandas is mostly pretty nice, so I would just look up how to do some specific thing should the "old way" stop working.

    • @mikesak7994
      @mikesak7994 4 года назад +1

      @@waynezor Release candidate means that features are probably set, it just needs more testing before they release the stable version. Agree with the rest, but why not include the new things if they are worth noting from now on?

  • @736939
    @736939 4 года назад +116

    Thank you Corey. After this Pandas tutorials, please start the scikit-Learn and then TensorFlow2 tutorials

    • @ryanlee619
      @ryanlee619 4 года назад +4

      most likely never going to happen :(, but this would be soo good

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

      Wish that could be possible. ':(

  • @p3000g1
    @p3000g1 2 года назад +60

    Hands down best python tutorials on youtube. Nobody does so much for free. Thanks Corey

    • @im4485
      @im4485 Год назад +2

      it isn't free

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

      @@im4485 I def subscribed to brilliant.

  • @bartoszturkowyd3608
    @bartoszturkowyd3608 4 года назад +73

    I'm using pandas for a quite long time and sometimes I found it annoying (yet still very useful and mandatory in data science). Your videos make this library crystal clear. Thank you for this!

  • @alexandertsiolkovski5848
    @alexandertsiolkovski5848 4 года назад +34

    Corey, I just want to appreciate your work here. I am learning a lot from your videos. Thank you for making them freely available.

  • @sheilaokolie93
    @sheilaokolie93 Год назад +2

    Talk about beginner friendly?? This is one!!! Hands down the best!!!!!!!

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

    1.To reset index after loading csv ; df.reset_index
    2 to set index after reading CSV; df.set_index(" ")
    3.To reset index in place and permanently change dataframe ; df.reset_index(inplace= True)
    4. To set index while reading the data(csv) ; df = pd.read_csv('data/survey_results_public.csv', index_col =" ")
    5. To sort your index alphabetically; df.index_sort
    5. To sort your index alphabetically in a descending order; df.index_sort(ascending = False)

  • @philinnc
    @philinnc 4 года назад +13

    Pandas is an enormously helpful tool with good documentation, but for those of us who learn best by example there can be a steep learning curve. These tutorials are the best I've seen for clearly and methodically working through the basics.

  • @kasyapdharanikota8570
    @kasyapdharanikota8570 2 года назад +4

    your tutorials are far better than the paid ones on other platforms

  • @EdwardRLyons
    @EdwardRLyons 4 года назад +10

    Thank you for this particular video. It's explained indexing in 15 minutes with much greater clarity than anything else I've used so far.

  • @sarangkharpate5780
    @sarangkharpate5780 4 года назад +9

    I learned Pandas on my own, by hit and trial, but after watching these videos, finally I am able to connect the dots and make some sense why things are like this. Thanks Corey, this will save my time to google every command :)

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

    How Kind Can Someone Be?
    He explains each and every detail and also explain things repeatedly so that anyone coming any of the video in the middle of the series will find it easy to follow the video.

  • @hameem6845
    @hameem6845 4 года назад +9

    I am using a string index in my current project and this is all very useful. Thanks! This pandas series is gonna be awesome.

  • @roberta.42
    @roberta.42 2 года назад +15

    Chapters:
    00:00 Intro
    00:30 Recap of Dataset
    01:00 Recap of What's an Index
    02:06 How to Set DataFrame (Row) Indexes ('df.set_index('col_to_use')')
    02:35 'inplace' Argument
    03:40 '.index' Attribute
    05:13 How to Reset (Row) Indeces ('df.reset_index()')
    06:16 Set (Row) Index on DataFrame Creation () and Practice on Real-World Dataset ('pd.read_csv('file.csv', index_col='col_to_use')'
    12:58 Sort Indexes (`df.sort_index(ascending=False)`)
    15:02 Outro
    Copied from @Adam Hendry for future reference

  • @sebastianhernandez3059
    @sebastianhernandez3059 4 года назад +8

    Can't believe how awesome you are! Really enjoying this series so far your instructions are so thorough and simple, you've really helped me grow so much in my aspirations. Thank you so much Corey, hope all is well in this tough time.

  • @Rafian1924
    @Rafian1924 Год назад +3

    Thanks a lot Corey.. you are the best instructor out there.. I can't even imagine learning from anybody else. Can you please consider creating a series on pyspark and machine learning??

  • @egyptsphinx9393
    @egyptsphinx9393 4 года назад +1

    I can`t ensure if you will believe me or not when i tell you that i downloaded 130 tutorial video of your content about python, but the most important thing that i am sure about is, you are awesome, keep going believer

  • @priyanshusaxena7157
    @priyanshusaxena7157 3 года назад +1

    You know what Corey, you are the only person I would like to thank once I become a data scientist...

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

    I enjoyed this video so much, thank you so much, I'm recommending your channel to all my friends. Watching your videos is a must!
    Thank you so much!!

  • @meta_ai
    @meta_ai 4 года назад +9

    BEST #PYTHON #channel ever

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

    watched 1 and 2 . the best tutorial. And am watching the third. thanks a lot. you are the best.

  • @REKHAKUMARI-lv8mz
    @REKHAKUMARI-lv8mz 4 года назад +3

    Thanks a lot, Corey! It's evident that you put in a lot of effort into making your videos flawless. Where else could I get such clear and thorough explanations !?!

  • @ibrahimsma975
    @ibrahimsma975 3 года назад +1

    Thanks Corey for this awesome series... You are making complex things looks simple.. What I like the most about your series is that your Tutorial flow by explaining simple to complex in an understandable manner.. Keep this good work, you are bringing in differences in many Techies lives.

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

    I am finally getting into Pandas and these videos have been great!!!

  • @murrkerr04
    @murrkerr04 6 месяцев назад

    Wow, these videos are seriously so helpful! I've just been getting started with pandas, feeling frustrated because I just don't understand the syntax super well yet and thus having to google literally everything. This is making it so much easier to understand! I can't thank you enough and I'm looking forward to getting through all the videos! :)

  • @shantanukaushikmathoholic
    @shantanukaushikmathoholic 6 месяцев назад

    Awesome, this is best Pandas series so far I have watched on internet...

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

    Really great videos Part 1, 2 and now 3. It was so hard to find a good Pandas tutorial but yours is Ivy School level explanation. 🎉

  • @IvanToman
    @IvanToman 4 года назад +68

    Manager Idiot is the best

    • @akioo9495
      @akioo9495 3 года назад +5

      they removed that question in 2020 survey xD

  • @vijaybabu3923
    @vijaybabu3923 4 года назад +2

    Very nice video.. will recommend anyone who is in the world of data engineering. will look forward for the next video! Thank you Corey 👍

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

    Thanks for this series, @Corey! Very helpful and very well done. I went to Brilliant to check them out to thank them for sponsoring your videos! Thanks Brilliant!

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

    Watching one video everyday after work! Thanks for the amazing videos. They're easy to follow. I am looking forward to check the other courses as well.

  • @SolvingOptimizationProblems
    @SolvingOptimizationProblems 4 года назад +2

    The index tips are so useful to work with dataframe. Thank you for such a great work.

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

    I don't know how to thank you enough for this free gift. I wish I could subscribe more than once to this channel. you turn my life around. thank you

  • @sandeepsingh-sp7yn
    @sandeepsingh-sp7yn 4 года назад +4

    Hey Corey, Your way of teaching is really awesome, Anyone who is beginner can also grab it and take it forward easily. Waiting for your upcoming videos on pandas :-) and looking forward to new series in python like numpy etc. which can help us in data analysis. You are doing a great job.

  • @lefttraces7207
    @lefttraces7207 3 года назад +1

    This series is an instructional masterpiece!

  • @dianavillescas
    @dianavillescas 3 года назад

    I a so glad I found you video. Finally I found the answer I was looking for for 2 hours!. Thank you.

  • @nathandai7510
    @nathandai7510 4 года назад +23

    7:20
    respondent 0: "I am a sttudent learning to code"
    stack overflow: "are you a student"
    respondent 0: "no"
    stack overflow: "what is your education level"
    respondent 0: "elementary school"
    stack overflow: *mike wazowski bruh face

    • @hRECKit
      @hRECKit 3 года назад

      i dont need sleep i need answers

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

    I keep refering back to these pandas tutorial videos whenever I needed. Great job @coreyms.

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

    i can't believe I'm getting this for free
    thank you sir

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

    Hey Corey, you did justice to this lecture! All for free! Be blessed!

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

    I am an amateur coder, I also have never posted a RUclips comment, but thank you.... these videos are incredible

  • @dark4krad
    @dark4krad 4 года назад +4

    About time. Great timing! Thank you sir! Respect to you!

  • @cathieajuex7223
    @cathieajuex7223 11 месяцев назад

    You are extremely a nice teacher. Good and detailed explanations in all your videos i have watched. Keep it up rolling for us beginners

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

    Thank you for the video. I am grateful for your time and contribution. Kind regards, Akira.

  • @saitaro
    @saitaro 4 года назад +3

    This is top quality stuff again. As always from Corey.

  • @subject8123
    @subject8123 4 года назад +1

    Talk about timing, I just started this series this morning

  • @DanteHellDrive
    @DanteHellDrive 4 года назад +2

    wow excellent tutorial, really well explained with awesome clarity. Keep up the good work!

  • @nakshatragarg
    @nakshatragarg 4 года назад +1

    Thanks, Corey! This playlist is really insightful

  • @TopicalAuthority
    @TopicalAuthority 4 года назад +2

    Great lesson thank you!

  • @Mysterious_debris_1111
    @Mysterious_debris_1111 4 года назад +1

    Best possible explanations ever...

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

    Thank you very much for this clear and informative video! 😄

  • @stephanie_ong
    @stephanie_ong 4 года назад +1

    Great tutorial video as always. Thanks!

  • @VikasGuptacherie
    @VikasGuptacherie 4 года назад +2

    Thank you!! Very important and nice video series

  • @darkmaraux
    @darkmaraux 4 года назад +1

    So nice! I will like and coment in every video of this set! You deserve the best! thanks!

  • @alexandro_coutinho
    @alexandro_coutinho 6 месяцев назад

    Great lesson! Thank you!

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

    Great course with clear explanation, great help to me. Thanks a lot.

  • @somyagupta2905
    @somyagupta2905 4 года назад +1

    Thanks a lot Corey, your videos are very helpful :)

  • @BrijeshYadav-vl7bj
    @BrijeshYadav-vl7bj 8 дней назад

    Very helpful videos indeed.

  • @JoshuaDHarvey
    @JoshuaDHarvey 4 года назад +1

    Great video, thank you! 14:000 I know you covered - pd.set_options('display.max_columns',##) but I can't seem to get the schema dataframe to show that even if I do run that... - nevermind, I figured it out. It was just pd.set_options('display.max_rows',##) and I think you did cover that! Anyway, thanks again Corey!

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

    As usual great video, thanks again!

  •  4 года назад +2

    Hey Corey. Your tutorials are awesome. It would be great if you produce how to use importlib library and dynamic module importing tutorials in future videos. Thank you very much.

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

    Thank you so much for this wonderful pandas series🙏

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

    Yet another lovely lesson. Nice flow with a good combination of motivation and technical instruction. Thanks.
    Just wondering how common the inplace=True argument is across Python generally, or is it specific to Pandas- first time I've seen it.

  • @mohameda.abokhoshiem2624
    @mohameda.abokhoshiem2624 4 года назад

    Corey Schafer, you 're amazing. Thank you.

  • @youssefelbieh2939
    @youssefelbieh2939 4 года назад +3

    Please Corey.. We need docker and microservices

  • @ishanpand3y
    @ishanpand3y 4 года назад +2

    Thank you, Sir! 🧡🤍💚

  • @prabhathkota107
    @prabhathkota107 4 года назад +1

    Very nice tutorial. Thank you.

  • @usmonov_dev
    @usmonov_dev 4 года назад

    Thank you bro ;) Couldn't wait to make data visualization.

  • @omeryazici5318
    @omeryazici5318 3 года назад

    print("BEST PYTHON LESSON ON UNIVERSE")

  • @galaxyhomehealthservices9898
    @galaxyhomehealthservices9898 4 года назад +1

    Thank you for the great videos .

  • @SHAli1474
    @SHAli1474 4 года назад +1

    Hey Corey
    A very good series. Learning from these and applying to Python visuals in Power BI. A bit limited in options there.
    Would it interest you to make a few videos on handling Python in Power BI?
    Thanks

  • @danielotieno5306
    @danielotieno5306 3 года назад +1

    Hi teacher, I love the videos, Thanks for taking us through,
    My data set after loading it in pandas its showing the "NaN" columns that are not there when i open the file direct using excel, what could be the issue?

  • @khelifa7278
    @khelifa7278 3 года назад

    Thanks bro you're so amazing

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

    3 down, 8 to go.. Dated 5/25/2023

  • @warrenvanwyck2765
    @warrenvanwyck2765 4 года назад

    Overall good stuff. More thought needs to be given when choosing example data. For rows and columns it's natural to speak of the first or last row -- and even the first or last column.. Using 'first' and 'last' for column names is needlessly ambiguous.

  • @rodkrebs9140
    @rodkrebs9140 3 года назад

    Thanks!! very insightful, good video

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

    Thank you.

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

    Remercie for your work!

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

    Hi Corey, thank you so much for this tutorial but I keep getting something missed up, Iin what context do we use the normal parenthesis (), this {} and the squared bracket [] ????

  • @akhilmehta8248
    @akhilmehta8248 4 года назад +3

    Thank you Corey for the video.
    I have a small doubt:
    pd.set_option('display.max_columns',85)
    pd.set_option('display.max_rows',85)
    After this command if we print df, shouldn't we see 85 rows of df?
    Or am I getting this wrong?

    • @techtime5989
      @techtime5989 11 месяцев назад

      Corey, I have same question as this

  • @ganeshbala
    @ganeshbala 4 года назад

    Thank you, Corey!

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

    Awesome
    Thanks

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

    thank you

  • @joro8604
    @joro8604 4 года назад

    So well explained....

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

    Video 3, On the way to the next one :D

  • @ajitesh764
    @ajitesh764 4 года назад +2

    1st comment...didn't watch it...first i like corey's video then i watch it...PS: First i disable my adblock....i urge everyone to do the same. Just out of curiosity...how many videos this pandas series consist of?..thank you for amazing videos..you're the best teacher Corey.

    • @coreyms
      @coreyms  4 года назад +9

      I still haven't finished recording the series yet, so I'm not exactly sure how I'll break up the last videos. But I _think_ it's going to end up being around 10 videos or so. Then I'm going to do another series of 5-10 videos specifically on plotting in Pandas.

    • @bhaukalifacts7139
      @bhaukalifacts7139 4 года назад +2

      Sir Can you please make Videos on ML also. You teach like a teacher is teaching to a 1st class student. I am very curious to study ML lectures by you Sir. Thankyou very much sir .😊😊

  • @piyushjain5852
    @piyushjain5852 4 года назад +1

    Which topics will you cover in the future videos of this series?

  • @tireldenamse5854
    @tireldenamse5854 4 года назад +1

    Good job!

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

    You deserve ⭐️⭐️⭐️⭐️⭐️

  • @akashpatil9161
    @akashpatil9161 6 месяцев назад

    Does using "inplace= True" changes csv file data arrangement?

  • @sharbi9943
    @sharbi9943 4 года назад

    Can't understand why would anyone dislike such a high quality work?!!! Thank you Corey...
    one simple question, when using methods (df.set_index()) I get an error on Spyder.
    'DataFrame' object has no attribute 'set_index'.... it works if pd.set_index is used instead?

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

    Thanks a lot. My question is how let index start from 1 instead of 0? Also, how to show ordinal number instead of ordinary numbers?

  • @user-nu4od6th5l
    @user-nu4od6th5l 2 года назад

    Am from Iran
    I love u😍

  • @GREATEXTREME7
    @GREATEXTREME7 4 года назад

    Love your videos

  • @Kig_Ama
    @Kig_Ama 3 года назад

    How can I use other column names than the original and go back to the original column names when I am done?

  • @joysharma8599
    @joysharma8599 4 года назад

    hey corey, please create some videos on numpy!

  • @akashpatil9161
    @akashpatil9161 6 месяцев назад

    what is difference between "pd.set_option('display.max_rows', 100)" and "pd.options.display.min_rows = 100"?

  • @GlobalWarming_x
    @GlobalWarming_x 3 года назад

    Bless you !!!

  • @debojitmandal8670
    @debojitmandal8670 3 года назад

    Can you please also make machine learning tutorials .
    And please provide time stamp for this video.

  • @muhammadazizrahman2264
    @muhammadazizrahman2264 4 года назад +1

    Thankyou Sir