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

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

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

  • @mrfrozen97-despicable
    @mrfrozen97-despicable 4 ปีที่แล้ว +33

    You taught me more than my college teachers combined

  • @KeithGalli
    @KeithGalli  5 ปีที่แล้ว +63

    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 4 ปีที่แล้ว

      Thanku ❤️ bro

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

      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 3 ปีที่แล้ว

      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 3 ปีที่แล้ว

      @Maximus Zyaire Instablaster =)

    • @maximuszyaire2849
      @maximuszyaire2849 3 ปีที่แล้ว

      @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.

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

    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 ปีที่แล้ว +5

      PAKISTAN AND CHINESE ARE FRIENDS(老铁)

    • @NewsToday196
      @NewsToday196 3 ปีที่แล้ว

      me too Pakistani and a fan

  • @Tyson_Watermelon
    @Tyson_Watermelon 4 หลายเดือนก่อน +1

    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

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

    As always, I am amazed by the value you bring to TH-cam. 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

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

    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 4 ปีที่แล้ว

      Keith is a living legend!

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

    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 2 ปีที่แล้ว

      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.

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

    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!

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

    Just went through one of your tutorial and I feel like a pro already..hope you keep doing more of this

  • @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.

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

    what I love about this video is that it is ad free. ❤️

    • @tech4028
      @tech4028 4 ปีที่แล้ว

      get yourself an adblocker

  • @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.

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

    Use a logarithmic scale to plot your first histogram in a way that displays all the players
    plt.yscale('log', nonposy='clip')

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

    big thumbs up to you
    even 3.5 years later from the date that you uploaded the video

  • @clockfixer5049
    @clockfixer5049 2 ปีที่แล้ว +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.

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

    Yours are the greatest videos and content I have ever met on the internet. Thank you very much

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

    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!

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

    You are simply my best teacher of all times in regards to data scientist.
    Great my pal.

  • @pipertripp
    @pipertripp 5 ปีที่แล้ว +7

    Great vid. At 28:14... you can just make the y-axis logarithmic with the log=True param and the histogram looks a lot better. Also, use edgecolor='white' or some other colour to create some separation between the bins.

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

      Great suggestions! Anyone reading this comment take note. Thank you :)

    • @pipertripp
      @pipertripp 5 ปีที่แล้ว

      @@KeithGalli , any time. Thx again for the great content!

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

      Wonderful suggestion!!

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

      That was helpful. Noted :)

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

    binged all of your python videos before my intro to programming exam. thank u for your service :,)

  • @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.

  • @yuniglucklich2400
    @yuniglucklich2400 4 ปีที่แล้ว

    this channel provides the best resource for data science in my perspective. subscribe guys, it's worth it

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

    Dude, the box plot explanation was very good. Better than many I've seen so far. thx.

  • @ajeetmani3154
    @ajeetmani3154 4 ปีที่แล้ว

    Out of many python videos on TH-cam, I always stuck to your videos. You are awesome!!!

  • @nickt423
    @nickt423 5 ปีที่แล้ว +27

    @16:18 For those of you who were not getting the countries in the legend add *label= country* to your plt.plot statement

  • @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

  • @Nahzh-m1r
    @Nahzh-m1r หลายเดือนก่อน

    What a hot teacher to lean data science from

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

    This video was very very useful. I followed them to detail and did these visualizations. Great work! :)

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

    It was just an awesome video, even I have learnt how to perform my matplotlib skills over dataset. Thank you Keith Galli Sir.

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

    60K SUBSCRIBERS, WOW THE COMMUNITY IS GROWING. WELL DONE KEITH

  • @AsyDarlyn
    @AsyDarlyn 3 ปีที่แล้ว +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

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

    Really enjoying the videos and have a lot of free time with NHL and other sports are down.
    The time well spent, thank you.

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

    'Im going to be a little bit hackey here' Like it . Must get a T shirt printed 'A little bit Hackey'

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

    29:20 please keep sharing some small but valuable tricks like this, it helps me a lot

  • @markm531
    @markm531 3 ปีที่แล้ว

    Thank you so much for the videos. Some people overcomplicate pandas but this was easy to understand and follow along

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

    I love your coding style. Comprehensive and simple

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

    Thank you very much for all your videos!
    You are helping me a lot with my PhD.
    Go on!

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

    This is an AMAZING tutorial! Really appreciate this vid man!

  • @YOYO-eb1oi
    @YOYO-eb1oi 4 ปีที่แล้ว

    Really great Keith,Very appreciable videos.
    Please complete all the other graphs also.
    Thanks in advance.

  • @hotbuns1273
    @hotbuns1273 3 ปีที่แล้ว

    you're a lifesaver, these videos helped me tons, thank youuu, maybe I will get that research now

  • @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

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

    Already love your videos. And now I see you're a Hockey fan. You're a good man.

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

    Amazing vid, but some of this code seems outdated as of 19/08/2021. Fixes below...
    To show the markers on the graph, use:
    Make sure that label doesn't have a capital "L".
    To show the labels on the loop use the variable county as the label:

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

    Great Job Keith!!!
    Your videos and teaching approach are very comprehensive.
    Keep the good job.

  • @MarcusAgapus
    @MarcusAgapus 4 ปีที่แล้ว

    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 :)

  • @afnanmostafa8289
    @afnanmostafa8289 4 ปีที่แล้ว

    **If we make a list of the headers (ignoring the 'Year'), and then, add gas[country] instead of gas after invoking the for loop, we can avoid using the if-statement. However, your videos are amazing!! Just started learning Python and already loving it.**
    country = gas.columns[1:]
    markers = ['o', 'd', 'D', '^', '*', '>', '

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

    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

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

    How beautiful your way of teaching. Grateful to you. it was learn to fun.

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

    As always, spectacular content!!!! Thank you so much for doing these.

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

    just started watching your videos dude. you're amazing. thank you so much.

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

    You can also rotate the xticks to 90 and then use all the years with the plot figure figzie to (20,7)

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

    Dude you save my exam when you explain it's really easy to understand too bad my teacher is not as good as you for that xD

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

    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 :)

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

    on 16:45 , to make the legend outside the graph you can use the command:-
    plt.legend(bbox_to_anchor=(1.05, 1))

    • @robq5703
      @robq5703 3 ปีที่แล้ว

      Thanks

  • @451236mateus
    @451236mateus 4 ปีที่แล้ว

    Your tutorial videos have helped me a lot to learn python. Tks

  • @mohalemolefe
    @mohalemolefe 4 ปีที่แล้ว

    You deserve more than a million subscribers bro! Great tutorials

  • @dewan_shaheb
    @dewan_shaheb 4 ปีที่แล้ว

    Thanks a lot Keith, you surely explain things a lot easier!
    Great work man. And thanks again.

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

    for x in range(1,4,1): "thank you {}".format("indeed")... now is the time to start the "Solving real world data science tasks with Python Pandas!" video...keep safe in those hard days...

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

    Great tutorial !!! Its like learning from a friend

  • @somilmehta2141
    @somilmehta2141 3 ปีที่แล้ว

    Nice work buddy. You made each concept so simple to understand. Love form India :)

  • @poroshatyazdanbakhshghahya9091
    @poroshatyazdanbakhshghahya9091 3 ปีที่แล้ว

    You are amazing. Please do more Pandas real world projects

  • @vadimivanov6291
    @vadimivanov6291 4 ปีที่แล้ว

    I want to say thank you for your time.Useful and undestandable

  • @shinjoopark6258
    @shinjoopark6258 3 ปีที่แล้ว

    Thousand thanks for your videos❤ it's helping me so much with my report which i'm dealing with!

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

    while True:
    print('THANK YOU SO MUCH, DEAR!')

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

    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!

  • @sudhirmalik100
    @sudhirmalik100 4 ปีที่แล้ว

    I love you keith you are really a good teacher , love from INDIA

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

    Really enjoy your tutorials

  • @ravindufernando1225
    @ravindufernando1225 4 ปีที่แล้ว

    your videos are great, i learnt lot of stuff from your videos hope you make more tutorials about data science

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

    Your videos are really, really helpful. Thank You.

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

    In order to compute all the players, even the ones with a skill level above 90, you can use a log scale for the y axis. Fits well id say. Just add in your plt.hist(.... ,log = True)

  • @dobengoose
    @dobengoose 5 ปีที่แล้ว

    thanks for sharing your knowledge and expertise. Especially for beginners . keep on posting professor.

  • @kanefoster8780
    @kanefoster8780 4 ปีที่แล้ว

    Another great video! You're a king among men

    • @KeithGalli
      @KeithGalli  4 ปีที่แล้ว

      Haha I appreciate the kind words! Glad you're finding the videos helpful :)

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

    Great videos .. I need to learn this as my role is evolving and this is becoming a pre requisite

  • @vitorribeirosa
    @vitorribeirosa 3 ปีที่แล้ว

    Thanks for the classes.. They have been really handy to learn python...

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

    you are the GOAT man, thanks

  • @andres_b_bcn
    @andres_b_bcn 3 ปีที่แล้ว

    Once again, best use of my time. thanks a lot mate

  • @juanmazapata7530
    @juanmazapata7530 3 ปีที่แล้ว

    You have all my respect

  • @rickpala_
    @rickpala_ 4 ปีที่แล้ว

    these videos are incredibly useful, please keep it up!

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

    Keith great video’s man - clearly explained - really improving my coding skills 100% - any change you could do a matplotlib 3D wireframe contour surface heat map plots tutorial? Cheers 🍻 buddy

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

      You can plot those things with the Seaborn library mate. I hope Keith does a tutorial for that aswell

  • @rayansuryadikara9353
    @rayansuryadikara9353 4 ปีที่แล้ว

    Thank you for your clear and thorough video!

  • @adrianapetrova196
    @adrianapetrova196 4 ปีที่แล้ว

    I totally adore the way you explain. Thanks for the videos :)

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

    Thanks a lot, your videos are really helpful. 😊

  • @datastako156
    @datastako156 3 ปีที่แล้ว

    thank you, i learned alot from your videos. more power!

  • @Luiz-bb9ve
    @Luiz-bb9ve 4 ปีที่แล้ว

    It helped me a lot. Thanks from Brazil

  • @harikrishna-harrypth
    @harikrishna-harrypth 3 ปีที่แล้ว

    Your videos are really helful! Thanks soo much man!

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

    just love it!!!, enjoyed learning throughout the Video

  • @duongtruong5691
    @duongtruong5691 3 ปีที่แล้ว

    in 42:00 . If you use Pycharm, you must convert 125 into '125' cause fifa.Weight[i] type is str. we can compare 2 str number like 2 int

  • @AdventuresOfChinchin
    @AdventuresOfChinchin 3 ปีที่แล้ว

    lol you should come and teach at our university, learning this is fun and all thanks to you!

  • @wafaza7934
    @wafaza7934 3 ปีที่แล้ว

    thank you sooooooooooooooo much it helps me a lot ...................awesome video and excellent explanation ........keep on bro

  • @sudeshnaroy2966
    @sudeshnaroy2966 4 ปีที่แล้ว

    Thank you so much. Learning so much from your videos.

  • @kihunkim7498
    @kihunkim7498 5 ปีที่แล้ว

    really great tutorial !!. Thanks for helping me to understand Matplotlib

  • @alayetmanel6986
    @alayetmanel6986 3 ปีที่แล้ว

    You're helping me do my master's thank you really 💐💐

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

    After the In[18] i got a warning as to "No handles with labels found to put in legend.".What might be the reason?

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

    Thank you, these are absolute treasure🔥🔥

  • @rampedilesley9330
    @rampedilesley9330 3 ปีที่แล้ว

    Woooow great lesson indeed. Thank you so much.

  • @SaadKhan-rc4hz
    @SaadKhan-rc4hz 4 ปีที่แล้ว

    Hey Keith, excellent video you made. Can you please make a few tutorials on 3D plotting? covering from basics and using real data like you have done here? Thanks xx

  • @frankkoslowski6917
    @frankkoslowski6917 3 ปีที่แล้ว

    Very nice presentation! Tried to figure out the % labeling on basis of current understanding of string handling myself. Never guessed this ==> autopct='%.2f %%'

  • @mr_o47
    @mr_o47 4 ปีที่แล้ว

    Your videos really helped man :)
    Keep making tutorials

  • @anasshukri2960
    @anasshukri2960 5 ปีที่แล้ว

    Have been following your videos bruh. Please produce more content... different from others, your isnt boring

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

    Such a great video, thank you very much!