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

  Рет қаралды 390,297

Corey Schafer

Corey Schafer

Күн бұрын

In this video, we will be learning about the Pandas indexes.
This video is sponsored by Brilliant. Go to 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 about the Pandas index. Indexes allow us to label our rows so that we can access them more easily. We'll learn how to set, reset, and use indexes properly. Let's get started...
The code for this video can be found at:
bit.ly/Pandas-03
StackOverflow Survey Download Page - bit.ly/SO-Survey-Download
✅ Support My Channel Through Patreon:
/ coreyms
✅ Become a Channel Member:
/ @coreyms
✅ One-Time Contribution Through PayPal:
goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
www.amazon.com/shop/coreyschafer
▶️ You Can Find Me On:
My Website - coreyms.com/
My Second Channel - / coreymschafer
Facebook - / coreymschafer
Twitter - / coreymschafer
Instagram - / coreymschafer
#Python #Pandas

Пікірлер: 203
@coreyms
@coreyms 4 жыл бұрын
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 жыл бұрын
Hi Corey, can you please do tutorials on pytorch ? That would be so useful.
@alanbarzilay6866
@alanbarzilay6866 4 жыл бұрын
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 жыл бұрын
@@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?
@p3000g1
@p3000g1 Жыл бұрын
Hands down best python tutorials on youtube. Nobody does so much for free. Thanks Corey
@im4485
@im4485 Жыл бұрын
it isn't free
@enknot
@enknot 2 ай бұрын
@@im4485 I def subscribed to brilliant.
@bartoszturkowyd3608
@bartoszturkowyd3608 4 жыл бұрын
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!
@736939
@736939 4 жыл бұрын
Thank you Corey. After this Pandas tutorials, please start the scikit-Learn and then TensorFlow2 tutorials
@ryanlee619
@ryanlee619 4 жыл бұрын
most likely never going to happen :(, but this would be soo good
@historywithreese
@historywithreese 2 жыл бұрын
Wish that could be possible. ':(
@alexandertsiolkovski5848
@alexandertsiolkovski5848 4 жыл бұрын
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 Жыл бұрын
Talk about beginner friendly?? This is one!!! Hands down the best!!!!!!!
@kasyapdharanikota8570
@kasyapdharanikota8570 2 жыл бұрын
your tutorials are far better than the paid ones on other platforms
@philinnc
@philinnc 4 жыл бұрын
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.
@alncl9566
@alncl9566 Ай бұрын
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.
@sebastianhernandez3059
@sebastianhernandez3059 4 жыл бұрын
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.
@hameem6845
@hameem6845 4 жыл бұрын
I am using a string index in my current project and this is all very useful. Thanks! This pandas series is gonna be awesome.
@REKHAKUMARI-lv8mz
@REKHAKUMARI-lv8mz 4 жыл бұрын
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 !?!
@EdwardRLyons
@EdwardRLyons 4 жыл бұрын
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.
@utpalmohane1416
@utpalmohane1416 Жыл бұрын
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.
@ibrahimsma975
@ibrahimsma975 3 жыл бұрын
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.
@IvanToman
@IvanToman 4 жыл бұрын
Manager Idiot is the best
@akioo9495
@akioo9495 3 жыл бұрын
they removed that question in 2020 survey xD
@nathandai7510
@nathandai7510 4 жыл бұрын
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 2 жыл бұрын
i dont need sleep i need answers
@sarangkharpate5780
@sarangkharpate5780 4 жыл бұрын
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 :)
@srinivastipparthi4608
@srinivastipparthi4608 2 жыл бұрын
how do u learn ..how many works u did on your own
@muntadher8087
@muntadher8087 2 жыл бұрын
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!!
@SolvingOptimizationProblems
@SolvingOptimizationProblems 4 жыл бұрын
The index tips are so useful to work with dataframe. Thank you for such a great work.
@vijaybabu3923
@vijaybabu3923 4 жыл бұрын
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 8 ай бұрын
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!
@priyanshusaxena7157
@priyanshusaxena7157 3 жыл бұрын
You know what Corey, you are the only person I would like to thank once I become a data scientist...
@Rafian1924
@Rafian1924 Жыл бұрын
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??
@dark4krad
@dark4krad 4 жыл бұрын
About time. Great timing! Thank you sir! Respect to you!
@lefttraces7207
@lefttraces7207 3 жыл бұрын
This series is an instructional masterpiece!
@sandeepsingh-sp7yn
@sandeepsingh-sp7yn 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.
@murrkerr04
@murrkerr04 3 ай бұрын
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! :)
@egyptsphinx9393
@egyptsphinx9393 4 жыл бұрын
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
@roberta.42
@roberta.42 2 жыл бұрын
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
@shantanukaushikmathoholic
@shantanukaushikmathoholic 3 ай бұрын
Awesome, this is best Pandas series so far I have watched on internet...
@subject8123
@subject8123 4 жыл бұрын
Talk about timing, I just started this series this morning
@finncollins5696
@finncollins5696 10 ай бұрын
watched 1 and 2 . the best tutorial. And am watching the third. thanks a lot. you are the best.
@nakshatragarg
@nakshatragarg 3 жыл бұрын
Thanks, Corey! This playlist is really insightful
@Breezy89er
@Breezy89er 5 ай бұрын
I am finally getting into Pandas and these videos have been great!!!
@hamidoumaiga5733
@hamidoumaiga5733 3 жыл бұрын
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. 🎉
@meta_ai
@meta_ai 4 жыл бұрын
BEST #PYTHON #channel ever
@ishanpand3y
@ishanpand3y 4 жыл бұрын
NO DOUBT...
@DanteHellDrive
@DanteHellDrive 4 жыл бұрын
wow excellent tutorial, really well explained with awesome clarity. Keep up the good work!
@shankerkc01
@shankerkc01 Жыл бұрын
I keep refering back to these pandas tutorial videos whenever I needed. Great job @coreyms.
@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.
@saitaro
@saitaro 4 жыл бұрын
This is top quality stuff again. As always from Corey.
@darkmaraux
@darkmaraux 4 жыл бұрын
So nice! I will like and coment in every video of this set! You deserve the best! thanks!
@akira_asahi
@akira_asahi Жыл бұрын
Thank you for the video. I am grateful for your time and contribution. Kind regards, Akira.
@cathieajuex7223
@cathieajuex7223 8 ай бұрын
You are extremely a nice teacher. Good and detailed explanations in all your videos i have watched. Keep it up rolling for us beginners
@diegooliveira7713
@diegooliveira7713 7 ай бұрын
Thank you very much for this clear and informative video! 😄
@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
@stephanie_ong
@stephanie_ong 3 жыл бұрын
Great tutorial video as always. Thanks!
@VikasGuptacherie
@VikasGuptacherie 4 жыл бұрын
Thank you!! Very important and nice video series
@awusacollins
@awusacollins Жыл бұрын
Hey Corey, you did justice to this lecture! All for free! Be blessed!
@KingLiongWong
@KingLiongWong Жыл бұрын
Great course with clear explanation, great help to me. Thanks a lot.
@alexandro_coutinho
@alexandro_coutinho 4 ай бұрын
Great lesson! Thank you!
@mohameda.abokhoshiem2624
@mohameda.abokhoshiem2624 3 жыл бұрын
Corey Schafer, you 're amazing. Thank you.
@aswath_s
@aswath_s 4 жыл бұрын
Best possible explanations ever...
@narendrar9940
@narendrar9940 Жыл бұрын
As usual great video, thanks again!
@maruthigowda2921
@maruthigowda2921 Жыл бұрын
Thank you so much for this wonderful pandas series🙏
@somyagupta2905
@somyagupta2905 3 жыл бұрын
Thanks a lot Corey, your videos are very helpful :)
@TopicalAuthority
@TopicalAuthority 4 жыл бұрын
Great lesson thank you!
@prabhathkota107
@prabhathkota107 4 жыл бұрын
Very nice tutorial. Thank you.
@felixlichter2332
@felixlichter2332 10 ай бұрын
I am an amateur coder, I also have never posted a KZbin comment, but thank you.... these videos are incredible
@usmonov_dev
@usmonov_dev 4 жыл бұрын
Thank you bro ;) Couldn't wait to make data visualization.
@abdusinc2557
@abdusinc2557 Жыл бұрын
i can't believe I'm getting this for free thank you sir
@rodkrebs9140
@rodkrebs9140 3 жыл бұрын
Thanks!! very insightful, good video
@ishanpand3y
@ishanpand3y 4 жыл бұрын
Thank you, Sir! 🧡🤍💚
@galaxyhomehealthservices9898
@galaxyhomehealthservices9898 4 жыл бұрын
Thank you for the great videos .
@ganeshbala
@ganeshbala 3 жыл бұрын
Thank you, Corey!
4 жыл бұрын
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.
@joro8604
@joro8604 3 жыл бұрын
So well explained....
@khelifa7278
@khelifa7278 3 жыл бұрын
Thanks bro you're so amazing
@tireldenamse5854
@tireldenamse5854 4 жыл бұрын
Good job!
@GREATEXTREME7
@GREATEXTREME7 4 жыл бұрын
Love your videos
@wwpharmacist
@wwpharmacist Жыл бұрын
Awesome Thanks
@jongcheulkim7284
@jongcheulkim7284 2 жыл бұрын
Thank you.
@femi2873
@femi2873 11 ай бұрын
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)
@SHAli1474
@SHAli1474 4 жыл бұрын
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
@melsaied101
@melsaied101 Жыл бұрын
Remercie for your work!
@JoshuaDHarvey
@JoshuaDHarvey 4 жыл бұрын
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!
@markkennedy9767
@markkennedy9767 7 ай бұрын
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.
@gayratsaidakhmedov5451
@gayratsaidakhmedov5451 2 ай бұрын
thank you
@GlobalWarming_x
@GlobalWarming_x 2 жыл бұрын
Bless you !!!
@karishmakaris7165
@karishmakaris7165 4 жыл бұрын
thankyou 🙂
@alexanderten5497
@alexanderten5497 4 жыл бұрын
Thank you,)
@muhammadazizrahman2264
@muhammadazizrahman2264 4 жыл бұрын
Thankyou Sir
@kopilkaiser8991
@kopilkaiser8991 7 ай бұрын
You deserve ⭐️⭐️⭐️⭐️⭐️
@sukrityavardhan8179
@sukrityavardhan8179 Жыл бұрын
Amazing
@daegudude1048
@daegudude1048 4 жыл бұрын
Can't help myself laughing along with you for Manager Idiot haha, thanks for the great content always!
@user-nu4od6th5l
@user-nu4od6th5l 2 жыл бұрын
Am from Iran I love u😍
@anashaat95
@anashaat95 3 жыл бұрын
Great.
@youssefelbieh2939
@youssefelbieh2939 4 жыл бұрын
Please Corey.. We need docker and microservices
@omeryazici5318
@omeryazici5318 3 жыл бұрын
print("BEST PYTHON LESSON ON UNIVERSE")
@ShivamGupta-wn9mo
@ShivamGupta-wn9mo 3 ай бұрын
great
@danielotieno5306
@danielotieno5306 2 жыл бұрын
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?
@chinazomjennifer7985
@chinazomjennifer7985 Ай бұрын
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 [] ????
@husseinhadliye2992
@husseinhadliye2992 Жыл бұрын
@Corey Schafer Thanks for the tutorial it's really very good but how you can access the questions from another excel?
@joysharma8599
@joysharma8599 4 жыл бұрын
hey corey, please create some videos on numpy!
@sharbi9943
@sharbi9943 3 жыл бұрын
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?
@TarokhYaghoubi
@TarokhYaghoubi 2 жыл бұрын
Another Great Video . Thanks for sharing these ! ! ! ! love from Iran .
@sadrahz7562
@sadrahz7562 9 ай бұрын
nice
@akhilmehta8248
@akhilmehta8248 4 жыл бұрын
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 8 ай бұрын
Corey, I have same question as this
@sachin1905
@sachin1905 3 жыл бұрын
Hi Corey, i have been trying to locate the csv file that your are referencing here in the video at the link you mentioned in the details section.. and i cant seem to find the csv files.. can you help guide where to locate the csv files. It just help practice along when we have csv files along .
@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.
What is Pandas? Why and How to Use Pandas in Python
10:08
Python Programmer
Рет қаралды 592 М.
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 31 МЛН
Countries Treat the Heart of Palestine #countryballs
00:13
CountryZ
Рет қаралды 23 МЛН
Real World Data Cleaning in Python Pandas (Step By Step)
40:01
Ryan Nolan Data
Рет қаралды 52 М.
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 424 М.
Python Hash Sets Explained & Demonstrated - Computerphile
18:39
Computerphile
Рет қаралды 107 М.
How do I use the MultiIndex in pandas?
25:01
Data School
Рет қаралды 171 М.
I Built a Shelter House For myself and Сat🐱📦🏠
00:35
TooTool
Рет қаралды 31 МЛН