Python Plotting Tutorial w/ Matplotlib & Pandas (Line Graph, Histogram, Pie Chart, Box & Whiskers)

  Рет қаралды 316,501

Keith Galli

Keith Galli

Күн бұрын

Practice your Python Pandas data science skills with problems on StrataScratch!
stratascratch.com/?via=keith
In this video, we go through several real-world examples of using the Matplotlib & Pandas libraries to visualize data from CSV files. This is a follow-up to my introductory matplotlib video ( • Intro to Data Visualiz... ). Timeline for what we cover can be found in the comments.
We start by creating line graphs of global gas price data over time. We review how to add a title, x & y axis labels, and scale our graph. We review how to customize the style and size of our charts. Next, we look at the FIFA 19 player data to create a histogram, a couple pie charts, and a box and whisker plot.
If you enjoy this video, make sure to LIKE and SUBSCRIBE :) :)
If you have any questions or feedback, please let me know in the comments!
---------------------------------------------
Follow me on social media!
Instagram | / keithgalli
Twitter | / keithgalli
---------------------------------------------
Link to Source Code & Datasets!
github.com/KeithGalli/matplot...
Matplotlib Documentation:
matplotlib.org/api/_as_gen/ma...
Matplotlib Fonts:
jonathansoma.com/lede/data-stu...
Matplotlib Style Options:
matplotlib.org/3.1.0/gallery/...
Kaggle Data Link:
www.kaggle.com/karangadiya/fi...
---------------------------------------------
Video timeline!
0:00 - Intro & Video Overview
2:22 - Load Necessary Libraries & Download Data
3:48 - Line Graph Example (Plotting Data from CSV file)
21:52 - Histogram Example (FIFA Overall Skill Distribution)
29:25 - Pie Chart #1 (Counting data in CSV) - Visualizing Soccer Foot Preferences
36:41 - Pie Chart #2 (More advance Pandas Example) - Weight Distribution of FIFA Players
47:49 - Box & Whisker Plot (Comparing FIFA teams to one another)
1:00:37 - Final Comments
---------------------
If you are curious to learn how I make my tutorials, check out this video: • How to Make a High Qua...
Join the Python Army to get access to perks!
KZfaq - / @keithgalli
Patreon - / keithgalli
*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.

Пікірлер: 313
@bwiznation
@bwiznation 4 жыл бұрын
Just went through one of your tutorial and I feel like a pro already..hope you keep doing more of this
@keihinata3740
@keihinata3740 3 жыл бұрын
Hi Keith! Finished all your Python Data Science Tutorials for Pandas, NumPy, and Matplotlib. I can say that I really learned a lot from your videos and I admire your way of solving and navigating through problems. It's really interesting to see how real world data can be transformed into simple charts and graphs. I appreciate the work that you do and I hope you make more videos like this. Thank you!
@mrfrozen97-despicable
@mrfrozen97-despicable 3 жыл бұрын
You taught me more than my college teachers combined
@trip_monkey
@trip_monkey 3 жыл бұрын
+1
@terrisquire1940
@terrisquire1940 2 жыл бұрын
As always, I am amazed by the value you bring to KZfaq. I'm so grateful for all you do to help those wanting to learn new things. Thank you.
@mert6986
@mert6986 2 жыл бұрын
ı agree with you man, year became 2022 and still this video is useful amazingly. Unbelievable
@ajeetmani3154
@ajeetmani3154 4 жыл бұрын
Out of many python videos on KZfaq, I always stuck to your videos. You are awesome!!!
@kausthubkannan4519
@kausthubkannan4519 2 жыл бұрын
The presentation of the concepts are excellent . All the topics are to the point. I am addicted to your videos. I was trying to learn Python from free resources and found your videos. They are treasure. Keep on making such videos. Btw, Thanks a lot!
@ogidanadekunle8324
@ogidanadekunle8324 3 жыл бұрын
You are better than my instructor, your videos are awesome, I've watched three of them in just three days that I was introduced to them, how I wish I knew you before now. You are a blessing to the World.
@frankwc0o
@frankwc0o 2 жыл бұрын
Dude, the box plot explanation was very good. Better than many I've seen so far. thx.
@simiyuwekesa7388
@simiyuwekesa7388 4 жыл бұрын
Yours are the greatest videos and content I have ever met on the internet. Thank you very much
@alexal4
@alexal4 4 жыл бұрын
Really enjoying the videos and have a lot of free time with NHL and other sports are down. The time well spent, thank you.
@AsyDarlyn
@AsyDarlyn 3 жыл бұрын
Thank you so much for this video. I literally followed each step and it was truly helpful. Definitely subbed and I’m binge watching
@hannahm7179
@hannahm7179 4 жыл бұрын
you are the single reason my grade is so good in my Data Analysis class, you are amazing and I can not thank you enough for all these videos!!!!
@andyn6053
@andyn6053 3 жыл бұрын
Keith is a living legend!
@jorgeromero141
@jorgeromero141 2 жыл бұрын
You are simply my best teacher of all times in regards to data scientist. Great my pal.
@nicoleroach1427
@nicoleroach1427 5 жыл бұрын
As always, spectacular content!!!! Thank you so much for doing these.
@umeshbhatt2570
@umeshbhatt2570 4 жыл бұрын
This tutorial like next level to matplotlib.. Even paid courses didn't teach like this..you deserved mode subscribers...Hatts off to you keith
@WJAMSoares
@WJAMSoares 3 жыл бұрын
I'm trying to be better at Python and at the same time doing all this Math courses to improve my math skills, I just needed a quick tutorial on how to plot graph in Python, watched this video and the first one, amazing stuff, thank you very much for sharing the knowledge.
@MarcusAgapus
@MarcusAgapus 3 жыл бұрын
Amazing video Keith! I myself want to become a data analyst(because I like the business side of companies as well) and started learning python for data science/analysis over R and SAS. Really glad I found your channel :)
@skyawesomeris
@skyawesomeris 3 жыл бұрын
This is an AMAZING tutorial! Really appreciate this vid man!
@Tyson_Watermelon
@Tyson_Watermelon Ай бұрын
Dude, I've been trying to make a histogram like this from begining for 2 hours, jumping from StackOverflow, documentation and all kinds of websites and you just teach me in 2 minutes. You are great, keep up the good work
@RishikavsAnnie
@RishikavsAnnie 3 жыл бұрын
This is officially my go-to channel for understanding Python libraries. The documentation is very helpful, but going through it as a beginner can feel disengaging at times, so I'm happy to have found this channel!
@pkavenger9990
@pkavenger9990 Жыл бұрын
yeah, you remember when you apply modules on a real time project otherwise the truth is we developer only look at documentation when we need to, otherwise their are hundreds of commands that do hundreds of things and you cant remember all of them unless you use them very frequently.
@arslan809
@arslan809 4 жыл бұрын
Dude, I am addicted to your tutorials. Whenever I come home from work, I start watching your tutorials & practice. I use Python 2.7 and for this version, legend() command has some different script relative to Python 3.0. Best wishes & happy X-mas from Pakistan
@boringclub7540
@boringclub7540 4 жыл бұрын
PAKISTAN AND CHINESE ARE FRIENDS(老铁)
@NewsToday196
@NewsToday196 3 жыл бұрын
me too Pakistani and a fan
@niteshprajapat7918
@niteshprajapat7918 3 жыл бұрын
It was just an awesome video, even I have learnt how to perform my matplotlib skills over dataset. Thank you Keith Galli Sir.
@jasmineathea7386
@jasmineathea7386 2 жыл бұрын
binged all of your python videos before my intro to programming exam. thank u for your service :,)
@asomya87
@asomya87 3 ай бұрын
This video was very very useful. I followed them to detail and did these visualizations. Great work! :)
@ezenweregozie5016
@ezenweregozie5016 Жыл бұрын
I love your coding style. Comprehensive and simple
@YOYO-eb1oi
@YOYO-eb1oi 4 жыл бұрын
Really great Keith,Very appreciable videos. Please complete all the other graphs also. Thanks in advance.
@markm531
@markm531 3 жыл бұрын
Thank you so much for the videos. Some people overcomplicate pandas but this was easy to understand and follow along
@evenmoreevil
@evenmoreevil 2 жыл бұрын
Already love your videos. And now I see you're a Hockey fan. You're a good man.
@hectormotsepe1581
@hectormotsepe1581 4 жыл бұрын
60K SUBSCRIBERS, WOW THE COMMUNITY IS GROWING. WELL DONE KEITH
@gabrielabdulai1637
@gabrielabdulai1637 4 жыл бұрын
Great Job Keith!!! Your videos and teaching approach are very comprehensive. Keep the good job.
@KeithGalli
@KeithGalli 4 жыл бұрын
Thank you!!
@dewan_shaheb
@dewan_shaheb 3 жыл бұрын
Thanks a lot Keith, you surely explain things a lot easier! Great work man. And thanks again.
@rickpala_
@rickpala_ 4 жыл бұрын
these videos are incredibly useful, please keep it up!
@hotbuns1273
@hotbuns1273 2 жыл бұрын
you're a lifesaver, these videos helped me tons, thank youuu, maybe I will get that research now
@adrianapetrova196
@adrianapetrova196 4 жыл бұрын
I totally adore the way you explain. Thanks for the videos :)
@albertoparera6451
@albertoparera6451 Жыл бұрын
just started watching your videos dude. you're amazing. thank you so much.
@piyushlakhani3571
@piyushlakhani3571 4 жыл бұрын
just love it!!!, enjoyed learning throughout the Video
@federicomollica2617
@federicomollica2617 2 жыл бұрын
Thank you very much for all your videos! You are helping me a lot with my PhD. Go on!
@aalptekin
@aalptekin Жыл бұрын
big thumbs up to you even 3.5 years later from the date that you uploaded the video
@vadimivanov6291
@vadimivanov6291 4 жыл бұрын
I want to say thank you for your time.Useful and undestandable
@Lucia321
@Lucia321 2 жыл бұрын
Keith thank you so much! I really like your tutorials and as a total noob you have really taught me a lot :) greetings from the netherlands
@mohalemolefe
@mohalemolefe 4 жыл бұрын
You deserve more than a million subscribers bro! Great tutorials
@amitprakash3099
@amitprakash3099 2 жыл бұрын
Keith your voice has very natural speed. You do not try to unnaturally speed up your talk and that is the best thing about your videos.
@mphokhotleng6280
@mphokhotleng6280 4 жыл бұрын
Wonderful Tutorial Keith :) Thank you for this.
@dobengoose
@dobengoose 4 жыл бұрын
thanks for sharing your knowledge and expertise. Especially for beginners . keep on posting professor.
@shinjoopark6258
@shinjoopark6258 3 жыл бұрын
Thousand thanks for your videos❤ it's helping me so much with my report which i'm dealing with!
@kihunkim7498
@kihunkim7498 5 жыл бұрын
really great tutorial !!. Thanks for helping me to understand Matplotlib
@maxvinella941
@maxvinella941 5 жыл бұрын
Excellent tutorial.... looking forward to new ones!
@moremystic
@moremystic 2 жыл бұрын
Great tutorial !!! Its like learning from a friend
@shuvoyoutube270
@shuvoyoutube270 Жыл бұрын
How beautiful your way of teaching. Grateful to you. it was learn to fun.
@baijuthomas3716
@baijuthomas3716 4 жыл бұрын
Great videos .. I need to learn this as my role is evolving and this is becoming a pre requisite
@rayansuryadikara9353
@rayansuryadikara9353 4 жыл бұрын
Thank you for your clear and thorough video!
@Niharika731
@Niharika731 Жыл бұрын
Your videos are really, really helpful. Thank You.
@451236mateus
@451236mateus 4 жыл бұрын
Your tutorial videos have helped me a lot to learn python. Tks
@somilmehta2141
@somilmehta2141 3 жыл бұрын
Nice work buddy. You made each concept so simple to understand. Love form India :)
@pkavenger9990
@pkavenger9990 Жыл бұрын
Really enjoy your tutorials
@mr_o47
@mr_o47 4 жыл бұрын
Your videos really helped man :) Keep making tutorials
@axeyohole4133
@axeyohole4133 4 жыл бұрын
what I love about this video is that it is ad free. ❤️
@tech4028
@tech4028 4 жыл бұрын
get yourself an adblocker
@Italya3343
@Italya3343 4 жыл бұрын
Many Thanks for sharing Allll you amazing videos with us!!! like many others, we'd love to see more and more End-to-End real life tasks like this one, while you're explaining everything in details, and even showing us different ways doing the same thing!! :D:D really hope if you can make more videos with Matplotlib & Pandas, sklearn and other famous libraries, tasks like Datacamp projects or any real life task! Thanks in advance and wish you the best in your channel!
@harikrishna-harrypth
@harikrishna-harrypth 3 жыл бұрын
Your videos are really helful! Thanks soo much man!
@ravindufernando1225
@ravindufernando1225 4 жыл бұрын
your videos are great, i learnt lot of stuff from your videos hope you make more tutorials about data science
@andres_b_bcn
@andres_b_bcn 3 жыл бұрын
Once again, best use of my time. thanks a lot mate
@yuniglucklich2400
@yuniglucklich2400 4 жыл бұрын
this channel provides the best resource for data science in my perspective. subscribe guys, it's worth it
@vitorribeirosa
@vitorribeirosa 3 жыл бұрын
Thanks for the classes.. They have been really handy to learn python...
@jonathandiaz9764
@jonathandiaz9764 4 жыл бұрын
Thanks a lot for these videos. Greetings from Peru!!
@Luiz-bb9ve
@Luiz-bb9ve 4 жыл бұрын
It helped me a lot. Thanks from Brazil
@clockfixer5049
@clockfixer5049 2 жыл бұрын
Thanks for the vid! A few things I'd like to say addressing the beginners: the solutions given by Keith are workable but several of them are suboptimal. 1) When the expected number of plots on one graph is too much - you should definitely switch to the OOP approach (fix, axes = plt.subplots(nrows, ncols, figsize=()) etc.) Even when you have just one plot it's much better to use OOP: plt.subplots(1,1) 2) The conditional slicing is heavily suboptimal. Pandas has a 'cut' method which saves all the unwieldy conditional slicing. Sorry if I'm not the first one to point that out.
@datastako156
@datastako156 3 жыл бұрын
thank you, i learned alot from your videos. more power!
@grays10101
@grays10101 4 жыл бұрын
Your videos are really helpful. Thank you.
@sandip9901
@sandip9901 2 жыл бұрын
Thank you, these are absolute treasure🔥🔥
@benlevy1664
@benlevy1664 4 жыл бұрын
Use a logarithmic scale to plot your first histogram in a way that displays all the players plt.yscale('log', nonposy='clip')
@josueramirez1066
@josueramirez1066 4 жыл бұрын
Bro your videos are the best!!!!
@sudeshnaroy2966
@sudeshnaroy2966 4 жыл бұрын
Thank you so much. Learning so much from your videos.
@kasimshobak3281
@kasimshobak3281 4 жыл бұрын
That's so cool man! keep it up.
@nickt423
@nickt423 4 жыл бұрын
@16:18 For those of you who were not getting the countries in the legend add *label= country* to your plt.plot statement
@siddharthpanwar8169
@siddharthpanwar8169 4 жыл бұрын
saved!!!
@robq5703
@robq5703 3 жыл бұрын
Thanks a lot !
@oumarfaradiop1513
@oumarfaradiop1513 3 жыл бұрын
Thanks Dude
@nguyennhi5619
@nguyennhi5619 4 жыл бұрын
Keep going! You're doing great work. Thanks from Viet Nam
@KeithGalli
@KeithGalli 5 жыл бұрын
Video Timeline! 0:00 - Intro & Video Overview 2:22 - Load Necessary Libraries & Download Data 3:48 - Line Graph Example (Plotting Data from CSV file) 21:52 - Histogram Example (FIFA Overall Skill Distribution) 29:25 - Pie Chart #1 (Counting data in CSV) - Visualizing Soccer Foot Preferences 36:41 - Pie Chart #2 (More advance Pandas Example) - Weight Distribution of FIFA Players 47:49 - Box & Whisker Plot (Comparing FIFA teams to one another) 1:00:37 - Final Comments Subscribe to my channel pretty please friends!! :)
@eagleeyewolfpaw-birsheoran2196
@eagleeyewolfpaw-birsheoran2196 3 жыл бұрын
Thanku ❤️ bro
@zeteri4563
@zeteri4563 3 жыл бұрын
Thank you so much for the video!! I spent HOURS trying to figure out a simple plot, and after several videos your the one who was finally able to help me!
@maximuszyaire2849
@maximuszyaire2849 2 жыл бұрын
you probably dont give a shit but does anyone know of a method to get back into an instagram account?? I was dumb forgot my password. I would love any help you can give me
@maxtonkyrie4648
@maxtonkyrie4648 2 жыл бұрын
@Maximus Zyaire Instablaster =)
@maximuszyaire2849
@maximuszyaire2849 2 жыл бұрын
@Maxton Kyrie Thanks for your reply. I got to the site thru google and I'm in the hacking process atm. I see it takes a while so I will reply here later when my account password hopefully is recovered.
@RaphaProgame
@RaphaProgame 2 жыл бұрын
Such a great video, thank you very much!
@ahmadkarim1144
@ahmadkarim1144 2 жыл бұрын
you are the GOAT man, thanks
@poroshatyazdanbakhshghahya9091
@poroshatyazdanbakhshghahya9091 3 жыл бұрын
You are amazing. Please do more Pandas real world projects
@kanefoster8780
@kanefoster8780 3 жыл бұрын
Another great video! You're a king among men
@KeithGalli
@KeithGalli 3 жыл бұрын
Haha I appreciate the kind words! Glad you're finding the videos helpful :)
@MucahitKatirci
@MucahitKatirci 3 жыл бұрын
Learned a lot. Thanks.
@chaudiep8274
@chaudiep8274 Жыл бұрын
29:20 please keep sharing some small but valuable tricks like this, it helps me a lot
@obinnasunday2823
@obinnasunday2823 2 жыл бұрын
Thanks a lot, your videos are really helpful. 😊
@rampedilesley9330
@rampedilesley9330 3 жыл бұрын
Woooow great lesson indeed. Thank you so much.
@youssoufsougueh396
@youssoufsougueh396 4 жыл бұрын
Great tutorial!!, Thanks for teaching
@sudhirmalik100
@sudhirmalik100 3 жыл бұрын
I love you keith you are really a good teacher , love from INDIA
@loveyoutube22
@loveyoutube22 4 жыл бұрын
Thank you so much. It is easy to understand whatever u teach. Keep it up! I was surprised to hear u guys follow European footbal :) Btw I was in Boston several times, great city!! and with a soccer team
@KeithGalli
@KeithGalli 4 жыл бұрын
Thank you for the kind words! Glad you have enjoyed the tutorials. Yeah there's a huge sports presence here in boston which helps makes it a really fun place to live :)
@joshjung5083
@joshjung5083 2 жыл бұрын
Thank you as always!
@juanmazapata7530
@juanmazapata7530 2 жыл бұрын
You have all my respect
@wafaza7934
@wafaza7934 3 жыл бұрын
thank you sooooooooooooooo much it helps me a lot ...................awesome video and excellent explanation ........keep on bro
@alayetmanel6986
@alayetmanel6986 3 жыл бұрын
You're helping me do my master's thank you really 💐💐
@kanokda2336
@kanokda2336 4 жыл бұрын
You are the best. Thank you very much!!
@manjulachoudry4987
@manjulachoudry4987 4 жыл бұрын
Awesome video to learn matplotlib thanks u for videos
@alexrosliakov6805
@alexrosliakov6805 4 жыл бұрын
Thank you! Cool lesson!
@jatinkumar4410
@jatinkumar4410 3 жыл бұрын
Thanks. Very nice tutorial...
@ocraking
@ocraking 4 ай бұрын
Spectacular!!
@swapnilchaudhary9124
@swapnilchaudhary9124 3 жыл бұрын
my visualization concepts and its fun way to code in python and pandas to give output a visualization effect, it seems easy by reffering your video
@kylieying2
@kylieying2 5 жыл бұрын
Great tutorial!! Helped me with my MIT stats class!
@sahilnaik7681
@sahilnaik7681 2 жыл бұрын
Bro it's very much helpful.
@abhaytiwari6411
@abhaytiwari6411 4 жыл бұрын
welldone keith keep it up
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 64 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 56 МЛН
Exploratory Data Analysis with Pandas Python
40:22
Rob Mulla
Рет қаралды 442 М.
Matplotlib Full Python Course - Data Science Fundamentals
1:02:41
NeuralNine
Рет қаралды 123 М.
How to Create a Beautiful Python Visualization Dashboard With Panel/Hvplot
10:57
Thu Vu data analytics
Рет қаралды 533 М.
Professional Pandas Line Graph Plot in less than 10 Minutes
10:50
Python Simplified
Рет қаралды 39 М.
Solving real world data science tasks with Python Pandas!
1:26:07
Keith Galli
Рет қаралды 1,5 МЛН
Matplotlib Tutorial (Part 1): Creating and Customizing Our First Plots
35:01
Seaborn Is The Easier Matplotlib
22:39
NeuralNine
Рет қаралды 164 М.
Red❤️+Green💚=
00:38
ISSEI / いっせい
Рет қаралды 64 МЛН