Matplotlib Tutorial : Matplotlib Full Course

  Рет қаралды 124,413

Derek Banas

Derek Banas

Күн бұрын

Пікірлер: 214
@derekbanas
@derekbanas 4 жыл бұрын
TABLE OF CONTENTS 00:00 Intro 00:32 Importing 02:38 Simple Plotting 04:52 Multiple Plots 06:08 Using Figure Objects 12:32 Subplots 15:03 Appearance Options 21:28 Saving Plots 22:09 Working with Pandas Dataframe 29:01 TeX Markup (Math Symbols) 36:41 Histograms 40:57 Bar Charts 48:19 Pie Charts 53:50 Timeseries 59:31 Tables 1:08:21 Scatterplots 1:12:59 3D Surfaces 1:21:38 Matplotlib Finance 1:26:23 Heatmaps Probability in One Video : kzbin.info/www/bejne/qXbXlmeejaqagJo Statistics in One Video : kzbin.info/www/bejne/qpTYpHyFm66Sfa8 NumPy in One Video : kzbin.info/www/bejne/boqTooR7nZyXgMk Pandas in One Video : kzbin.info/www/bejne/hpTZpIKXnt2Inpo
@thunderbirdizations
@thunderbirdizations 3 жыл бұрын
1:33:45 Stayed til the end. Have an enormous project with a crazy learning curve ahead. I don’t plan on using matplotlib but I wanted to learn it before PlotLy to get a second perspective.
@m.aurelien2872
@m.aurelien2872 4 жыл бұрын
I was just finishing an implementation of a deep learning paper and needed to plot some stuff, great timing!
@derekbanas
@derekbanas 4 жыл бұрын
That's great! I'm happy I could help :)
@punkbuster2004
@punkbuster2004 8 ай бұрын
WOW , that was a really through class!!! I know that you din't dive too deep on every module, but it actually is not neeeded . anyone wanting to learn Python will find he's way, all we need is this headstart!!
@TheVerbalAxiom
@TheVerbalAxiom 3 жыл бұрын
I just realized I needed to learn matplotlib in DEPTH and of course it WOULD be Derek to help me, gotta love this freakin genius.
@digigoliath
@digigoliath 4 жыл бұрын
OMG!! Everything I need in 1 video. Derek, you are my superhero!!! SMASHING the LIKE Button!!
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :) I appreciate that!!!
@elijahkalii5290
@elijahkalii5290 3 жыл бұрын
You are the only guy I have found who can really teach me data analysis. You are really good at this Derek. Thank you. Elijah Kalii. Nairobi, Kenya
@arturowatson
@arturowatson 3 жыл бұрын
The college professor you wished you had! To say Derek knows his stuff is just a bit understated. Video moves rapidly covering many visualization possibilities using Jupyter notebook. One of the hurdles I've had with Matplotlib is that there are actually too many possibilities with disjointed specifics. The pace, logical progression and scope of this video is perfect, leaving the viewer with functioning code examples to run, modify and explore on their own. Bravo!
@derekbanas
@derekbanas 3 жыл бұрын
Thank you for the nice compliment :) I do this stuff for a living so I’m happy to hear that I was able to make it understandable.
@vedachintha
@vedachintha 2 жыл бұрын
This is a fantastic tutorial. Even though I have a lot of experience in plotting using Excel and PowerBI, for reasons unknown, I've always felt intimidated by the idea of plotting using python. From your video, I've gained a lot of knowledge and confidence, thank you so much for your effort. Also, many thanks for the ipynb file, much appreciated. Next stop - Seaborn Tutorial :-)
@derekbanas
@derekbanas 2 жыл бұрын
Thanks for taking the time to tell me it helped :) Enjoy Seaborn
@CKPSchoolOfPhysics
@CKPSchoolOfPhysics 2 жыл бұрын
Really powerful introduction of Matplotlib from basic to really advanced level. This has helped me tremendously in my ML plotting.
@GabrieleIuzzolino
@GabrieleIuzzolino 10 ай бұрын
Ty, the way you talk is really easy to understand for non-native English speakers like me
@MikkoHaavisto1
@MikkoHaavisto1 3 жыл бұрын
Thank you and keep making these! I've watched hundreds of Python videos here in KZbin, but yours might be the best.
@andreapaps
@andreapaps 2 жыл бұрын
This is great, the info comes at you so fast... Basically you see what is possible then when you need to actually use it you come back and pause the video and copy the code :D
@liapeterson1051
@liapeterson1051 2 жыл бұрын
By 12 minutes in, my mind was absolutely blown. Thank you for making these!
@derekbanas
@derekbanas 2 жыл бұрын
Thank you :) I'm very happy that I could help
@davidcrossey
@davidcrossey 4 жыл бұрын
This series has come up at a fantastic time in the Data Science / Machine Learning space. As a software engineer myself with weaker background in mathematics, trying to prepare for the future in this field has always been daunting. These video tutorials, along with the statistics series are extremely valuable to making this area more accessible & fun to learn - thank you @Derek Banas !
@derekbanas
@derekbanas 4 жыл бұрын
Thank you :) I’m doing my best to create a step-by-step course while also trying to present everything in new ways. I’ve been using data science for work for quite some time so I have my core toolset. I will however try to cover everything to the best of my ability. For example I mainly use PyTorch, but I’ll cover Tensorflow as well.
@GloomyElder
@GloomyElder 4 жыл бұрын
I just watched your Plotly and matplotlib tutorials, they are awesome, I' heading to watch the seaborn , numpy and and the other cool videos you have! Keep the great work, greetings from Mexico
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :) I love Mexico!
@sshashi67
@sshashi67 4 ай бұрын
Great video for starting off various charts...then do deep dive into specifics as needed using documentation. (Watched to the end!)
@markkennedy9767
@markkennedy9767 Жыл бұрын
At 23:50, why do we need to convert the pandas dataframe to a numpy array. Isn't pandas based on numpy. Also, many stackexchange posts suggest that .values (is this an attribute?) is not recommended to do this. They suggest using the function Dataframe to numpy() instead. At 38:10, why are you choosing stacked=True if there is only one data set for the histogram. Isn't this redundant (and kinda confusing)? At 48:10, surely you need to change the tick labels back form the index to the school types again using xticks(ticks, labels) etc?
@ericzheng4815
@ericzheng4815 2 жыл бұрын
This video is invaluable. It is so well-prepared and every plot is explained very clearly.
@derekbanas
@derekbanas 2 жыл бұрын
Thank you for the nice compliment :) I'm happy you found it useful!
@i-eto-projdjot
@i-eto-projdjot 2 жыл бұрын
Thanks for nice tutorial! Some shorthand for rounding in Tabels section: df.iloc[:, 1:6] = round(df.iloc[:, 1:6], 2) This line of code would round all values in all price columns
@debjyotiarr
@debjyotiarr 4 жыл бұрын
Commenting after watching the whole video and also following along on a Jupyter notebook of my own. Sincere gratitude to you!
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for taking the time to say I helped :) I greatly appreciate it
@MohammadYousofi-ho9bh
@MohammadYousofi-ho9bh 8 ай бұрын
Your teaching method is just great! I love the way you are teaching Sir. I recently purchased a Data Science course in Udemy from Jose Portilla, but his teaching method is not interesting to me at least. And I wanted to say that I rarely comment on videos on KZbin, and those are the ones I liked a lot like this video! Bravo!!!
@derekbanas
@derekbanas 8 ай бұрын
Thank you very much :) I'm glad that I could help.
@gavyn3258
@gavyn3258 4 жыл бұрын
Watched the whole video and followed along on Jupyter. Excellent content that deserves a like and subscribe
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :) I'm very happy that you enjoyed it
@maziarghorbani
@maziarghorbani 3 жыл бұрын
I watched the whole video but in two goes. As usual, very informative and professional. Thank you 🙂
@Naeem2460
@Naeem2460 Жыл бұрын
I just found your channel, and it has everything that i need, Thank you very much
@derekbanas
@derekbanas Жыл бұрын
Thank you :) I’m happy I could help
@RahulKumar-fc8cf
@RahulKumar-fc8cf Жыл бұрын
Great Content and very concise one. Really enjoyed learning plotting with Matplotlib. Keep up the good work.
@stacysanders7735
@stacysanders7735 Жыл бұрын
Thank you for a great video. I did watch until the end and appreciate the great pacing.
@odraudenoel
@odraudenoel 3 жыл бұрын
Thanks so much for your tutorials, I am a big fan! Always watch all the way to the end!
@eythoreinarsson6260
@eythoreinarsson6260 4 жыл бұрын
Watched the whole video, although I skipped some details since I am quite familiar with matplotlib. I liked slower pace of the video, it made it easy to casually watch the video without my full attention. I am looking forward to seaborn, which i have not used it yet, so you will have my full attention. Thank you very much for your videos, the amount and breadth of topics you are able to cover is amazing.
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for the input. Yes I just slightly slowed the video to see if anyone noticed. I appreciate both that you watched the video and that you said you preferred the slower speed I'll keep doing it. Yes Seaborn is next. It should be up in less than 6 days.
@umairsalim9442
@umairsalim9442 Жыл бұрын
Just completed the whole video, above everything else just loved the way you say 'anndddddd' 😅
@gabrielgirodo
@gabrielgirodo 3 жыл бұрын
Tks for the video! You made it very easy and the cheat sheet will come in handy. Now I will move to the seaborn tutorial. Have a great day!
@derekbanas
@derekbanas 3 жыл бұрын
I'm happy I could help :)
@olejir
@olejir 2 жыл бұрын
It's such an amazing course, thank u a lot. I'm so glad that I've found ur channel!
@derekbanas
@derekbanas 2 жыл бұрын
Thank you :) I'm very happy you found it useful!
@manavt2000
@manavt2000 Жыл бұрын
Thank you very much for this amazing tutorial! Love from Germany
@derekbanas
@derekbanas Жыл бұрын
I'm very happy you found it useful :)
@markkennedy9767
@markkennedy9767 Жыл бұрын
The syntax for subplotting is incredibly confusing. There are various functions e.g. subplot(), subplots(), add_subplot() or the axes() functions, all used in a variety of ways e.g. some as part of the module plt in plt.subplots() or plt.subplot() here and some as a method acting on the figure e.g. fig.add_subplots. Then there's the various and confusing indices for the arguments. For example, around 5:15, couldn't you first just assign plt.subplot() with its arguments to a variable e.g. ax1 and then on the next line have ax1.plot() with it's arguments. The reason I say this is that I can't understand how plt.plot() with its arguments knows how to work on the specific axis plt.subplot() etc on the line above it. I suspect fig.add_subplots is the best way to create subplots, but every video seems to do it differently. Surely at 11:50, the arguments for positioning the text for axes2 are based not on the centre of the figure being (0,0) as you say, but on the origin of axis 2 being (0,0). If you see where the text ends up, this is clear (around (0,40) relative to the axis 2 origin).
@sameerreddy7514
@sameerreddy7514 6 ай бұрын
Amazing tutorial. was easy to follow. thanks Derek.
@chriscoyne2881
@chriscoyne2881 3 жыл бұрын
stayed until the end and am now going to watch all of your other videos
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :) There are a lot of them!
@mgr1282
@mgr1282 4 жыл бұрын
Great series: numpy, pandas, matplotlib. what's next? tensorflow? pytorch? scikitlearn?
@derekbanas
@derekbanas 4 жыл бұрын
Thank you 😁 Yes I'll cover all of the above and more. Seaborn is next
@digigoliath
@digigoliath 4 жыл бұрын
@@derekbanas Wow!!
@markkennedy9767
@markkennedy9767 Жыл бұрын
Thank you for this. At 12:20, is there any good reason why the add_axes() method takes a list as argument, yet the text() method takes a tuple. It seems totally arbitrary since the arguments are both related to location etc.
@olevam1
@olevam1 3 жыл бұрын
Thanks to this video I finally understood how to modify axes properly (I need to create them in a figure first!) week of figuring it out paid off!
@derekbanas
@derekbanas 3 жыл бұрын
I'm happy I could help :)
@olevam1
@olevam1 3 жыл бұрын
@@derekbanas One questions, I have struggled to save the file, as it does not show the axes (and I noticed it does not show it in your video either) any thoughts on how to get the axes to show on the saved file?
@praleen_
@praleen_ 4 жыл бұрын
My first line of code worked at first try! \o/
@MarieAmeliaFreyaAster
@MarieAmeliaFreyaAster 3 жыл бұрын
Never trust computers
@dinoscheidt
@dinoscheidt 3 жыл бұрын
Super useful. Incredible preparation and delivery. Love from Berlin ❤️
@derekbanas
@derekbanas 3 жыл бұрын
Thank you for the nice compliment :)
@gerrywilson2035
@gerrywilson2035 4 жыл бұрын
God will bless you for giving free education... Keep it up... ✌️♥️
@gerrywilson2035
@gerrywilson2035 4 жыл бұрын
If possible try to cover keras and tensorflow
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for the nice message 😁 I tend to use PyTorch most often but I will definitely cover tensorflow and keras as well
@gerrywilson2035
@gerrywilson2035 4 жыл бұрын
@@derekbanas Thanks😊
@younesmakhchan2010
@younesmakhchan2010 3 жыл бұрын
dude , 3D Surfaces are amazing
@pavanim6258
@pavanim6258 4 жыл бұрын
Excellent content and very useful stuff..all in one video..thx a lot for sharing Derek
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :) Happy I could help
@yashjadhav3974
@yashjadhav3974 3 жыл бұрын
love your content man.......much support to you!!!
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :)
@kennethstephani692
@kennethstephani692 Жыл бұрын
Great video, Derek!!
@alwin5995
@alwin5995 2 жыл бұрын
completed the whole thing amazing
@gesuchter
@gesuchter 4 жыл бұрын
I am very ready for this one, thank you!
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for following my series :)
@mahmoudabdelaziz7994
@mahmoudabdelaziz7994 2 жыл бұрын
8:44 will anyone please tell me how you wrote the small 2 like that
@maxqin29
@maxqin29 3 жыл бұрын
Hi Derek, good job. How did you input x^2 in your Jupyter notebook at 8:43?
@daviaires2219
@daviaires2219 2 жыл бұрын
You mean how to input the "²"? ctrl + alt + 2 (not the 2 on the numpad, the other one)
@abhin.v4981
@abhin.v4981 2 жыл бұрын
That was an excellent tutorial. I did not understand why you used list comprehension at 41:18 instead of directly passing t_type as an argument?
@Pattypatpat7122
@Pattypatpat7122 11 ай бұрын
Great content! I learnt a lot
@ebbandari
@ebbandari 2 жыл бұрын
Fantastic tutorial. Thank you.
@deondoure1075
@deondoure1075 2 жыл бұрын
Good video thanks. I will watch it again.
@derekbanas
@derekbanas 2 жыл бұрын
Thank you :)
@jacquesfrancois4275
@jacquesfrancois4275 Жыл бұрын
5:15, Hi what does 1,2,1 refer to exactly in this instance?
@JasonOngVlog
@JasonOngVlog 2 жыл бұрын
Can anyone help me in adding labels for the scatterplot sample? I'm trying but it keeps getting errors.. the scatterplot is in 1:12:00
@ogadit
@ogadit 4 жыл бұрын
WAITING FOR THIS FOR SOO LONG
@derekbanas
@derekbanas 4 жыл бұрын
I hope you find it useful :)
@m.h.7121
@m.h.7121 4 жыл бұрын
top-notch tutorial as always. Thank you so much, man. You are my motivation that keeps me productive every day. BTW, I just noticed that your typing speed is getting slow. But I still like your content tho.
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :) I have been messing with the tutorial speed to see if people like videos that are slightly slower.
@m.h.7121
@m.h.7121 4 жыл бұрын
@@derekbanas Alright. I can see some data science projects over there...(I just travelled into the future).LOL
@josefkurk1492
@josefkurk1492 4 жыл бұрын
fajtastic review!! super easy to undestend:)
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much 😁
@TheLegalLens1
@TheLegalLens1 Жыл бұрын
At 7:20 , I can't get this code to run: `fig1 = plt.figure(figsize(5,4),dpi =100)` Error: NameError Traceback (most recent call last) Input In [7], in () ----> 1 fig1 = plt.figure(figsize(5,4),dpi =100) Any idea what I have wrong here?
@TheLegalLens1
@TheLegalLens1 Жыл бұрын
Chatgpt solved it: fig1 = plt.figure(figsize=(5,4),dpi=100) Explanation below -> 'The issue with your code is that you have specified the figsize argument incorrectly. The figsize argument expects a tuple of width and height values, but in your code, you have specified it as two separate values. To fix this issue, you can modify your code as follows: import matplotlib.pyplot as plt fig1 = plt.figure(figsize=(5,4), dpi=100) axes_1 = fig1.add_axes([0.1, 0.1, 0.9, 0.9]) axes_1.set_xlabel("x-axis label") plt.show() Thanks chatpgt
@TheLegalLens1
@TheLegalLens1 Жыл бұрын
Also just saw you correct the error @ 9:30 lol.....
@joaovaz3473
@joaovaz3473 4 жыл бұрын
Great video, as always! Btw, first.
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :)
@JackQuark
@JackQuark 2 жыл бұрын
Great tutorial, thanks.
@burner918
@burner918 3 жыл бұрын
Loved this video. Thank you so much.
@shreyasmd21
@shreyasmd21 3 жыл бұрын
thank you for making this video, it really helped me a lot!
@derekbanas
@derekbanas 3 жыл бұрын
I'm very happy that I could help :)
@bhavinmoriya9216
@bhavinmoriya9216 3 жыл бұрын
Thank you very much for the wonderful vide0 :)
@derekbanas
@derekbanas 3 жыл бұрын
Thank you :) I'm very happy you enjoyed it
@jamesjohnathan4424
@jamesjohnathan4424 3 жыл бұрын
Thanks for the valuable piece of information. Appreciate that :)
@derekbanas
@derekbanas 3 жыл бұрын
I'm happy to be of help :)
@jamesjohnathan4424
@jamesjohnathan4424 3 жыл бұрын
@@derekbanas big thanks sir
@igniculus_
@igniculus_ 4 жыл бұрын
Wow, thank you so much for this!
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for following my videos :)
@carlypetracco1107
@carlypetracco1107 4 жыл бұрын
Thank you, this was great!
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for taking the time to say it helped :)
@cvryn7
@cvryn7 3 жыл бұрын
Just finished it. thanks
@derekbanas
@derekbanas 3 жыл бұрын
Happy I could help :)
@garvsadh9983
@garvsadh9983 Жыл бұрын
in the timeseries section it shows the error that ValueError: x and y must have same first dimension, but have shapes (64,) and (251,) even after copying your code it does not seem to work What do you think might be the issue here im kinda stuck thanks
@upgraduate
@upgraduate 3 жыл бұрын
😊 very nice tutorial
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :)
@qtrix06
@qtrix06 4 жыл бұрын
Make a video on OpenCV please!
@sankalpchenna3355
@sankalpchenna3355 4 жыл бұрын
Hey Derek you are amazing I have learnt a lot from your machine series if possible can make a video on sikit learn And machine learning algorithms in python with real-time examples that would be great!! Again, thanks a lot for your effort it really makes a difference load of love from india..
@derekbanas
@derekbanas 4 жыл бұрын
Thank you very much :) Yes I plan to do both and a whole lot more. Seaborn is next
@vanshshah6418
@vanshshah6418 3 жыл бұрын
plt.scatter() plt.plot() plt.title() plt.xlabel() plt.ylabel() plt.show() plt is a module and all these scatter,plot,show are functions than how are they connected like where is the information from one function being stored so that another function can use it?? please answer me
@vishwad9372
@vishwad9372 4 жыл бұрын
Hi derek, I learned alot from you. (Thank you ) **1000
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for taking the time to tell me that :) I appreciate it
@Emma-mu7kj
@Emma-mu7kj 3 жыл бұрын
Thanks again for this great course! Could you show me your solution on Subplout IN[12] with a for loop?
@bennguyen1313
@bennguyen1313 4 жыл бұрын
Why is pandas, sometimes, but not always used in conjunction with matplotlib? Any suggestions on how to read/parse/plot a string from the (py)serial port, such that no data is dropped? The transmitter sends lines like "1.23, 3.3, 87.1 " every 500ms for approximately 2 minutes.. yet in the code below, the update to the plot seems to take too much time, because the data starts to get dropped (or gets backed up into a queue?), and does not get plotted nor csv saved . Is there more efficient way of plotting (animation) or using threads import serial import time import csv import threading import numpy as np import matplotlib matplotlib.use("tkAgg") import matplotlib.pyplot as plt #TODO : Use threads for Plot and Serial.. like ComPlotter or felipengeletrica /PyDatalogger ser = serial.Serial('/dev/ttyACM0') ser.flushInput() plot_window = 20 y_var = np.array(np.zeros([plot_window])) plt.ion() fig, ax = plt.subplots() line, = ax.plot(y_var) while True: try: ser_bytes = ser.readline() try: decoded_bytes = float(ser_bytes[0:len(ser_bytes)-2].decode("utf-8")) print(decoded_bytes) except: continue with open("test_data.csv","a") as f: writer = csv.writer(f,delimiter=",") writer.writerow([time.time(),decoded_bytes]) y_var = np.append(y_var,decoded_bytes) y_var = y_var[1:plot_window+1] line.set_ydata(y_var) ax.relim() ax.autoscale_view() fig.canvas.draw() fig.canvas.flush_events() except: print("Keyboard Interrupt") break ################################## ################################## ################################## def Main(): ser = None # serial.Serial(3, 11520) t1 = threading.Thread(target = Task1, args=[ser]) t2 = threading.Thread(target = Task2, args=[ser]) Report("Starting Thread 1") t1.start() time.sleep(3) Report("Starting Thread 2") t2.start() if __name__ == '__main__': Main() ################################## ################################## ################################## import serial import wx import numpy import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.figure import Figure import matplotlib.pyplot as plt class DataLoggerWindow(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, "ComPlotter", (100,100), (640,480)) self.SetBackgroundColour('#ece9d8') # Flag variables self.isLogging = False # Create data buffers self.N = 100 self.n = range(self.N) self.M = 3 self.x = [] for m in range(self.M): self.x.append(0 * numpy.ones(self.N, numpy.int)) # Create plot area and axes self.fig = Figure(facecolor='#ece9d8') self.canvas = FigureCanvasWxAgg(self, -1, self.fig) self.canvas.SetPosition((0,0)) self.canvas.SetSize((640,320)) self.ax = self.fig.add_axes([0.08,0.1,0.86,0.8]) self.ax.autoscale(False) self.ax.set_xlim(0, 99) self.ax.set_ylim(-100, 1100) for m in range(self.M): self.ax.plot(self.n,self.x[m]) # Create text box for event logging self.log_text = wx.TextCtrl( self, -1, pos=(140,320), size=(465,100), style=wx.TE_MULTILINE) self.log_text.SetFont( wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False)) # Create timer to read incoming data and scroll plot self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.GetSample, self.timer) # Create start/stop button self.start_stop_button = wx.Button( self, label="Start", pos=(25,320), size=(100,100)) self.start_stop_button.SetFont( wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False)) self.start_stop_button.Bind( wx.EVT_BUTTON, self.onStartStopButton) def GetSample(self, event=None): # Get a line of text from the serial port sample_string = self.ser.readline() # Add the line to the log text box self.log_text.AppendText(sample_string) # If the line is the right length, parse it if len(sample_string) == 15: sample_string = sample_string[0:-1] sample_values = sample_string.split() for m in range(self.M): # get one value from sample value = int(sample_values[m]) self.x[m][0:99] = self.x[m][1:] self.x[m][99] = value # Update plot self.ax.cla() self.ax.autoscale(False) self.ax.set_xlim(0, self.N - 1) self.ax.set_ylim(-100, 1100) for m in range(self.M): self.ax.plot(self.n, self.x[m]) self.canvas.draw() def onStartStopButton(self, event): if not self.isLogging: self.isLogging = True self.ser = serial.Serial() self.ser.baudrate = 38400 self.ser.timeout=0.25 # Try serial ports one by one starting # with COM30 and working downwards for m in range(29, 0, -1): self.ser.port = m try: # Try this port number self.ser.open() # We only get to here if port opened self.log_text.AppendText( 'Opened COM' + str(m+1) + '... ') break except: # We end up here if this port number # failed to open pass if self.ser.isOpen(): # We successfully opened a port, so start # a timer to read incoming data self.timer.Start(100) self.start_stop_button.SetLabel("Stop") else: self.timer.Stop() self.ser.close() self.isLogging = False self.start_stop_button.SetLabel("Start") if __name__ == '__main__': app = wx.PySimpleApp() window = DataLoggerWindow() window.Show() app.MainLoop()
@4getme2getme
@4getme2getme 10 ай бұрын
sir, How do you wrote a supersript x**2 casually in jupyter notebbok in code mode?! :O
@cl32
@cl32 4 жыл бұрын
Would you ever consider doing a Dafny tutorial? I've have a very short introduction to it in one of my uni classes and thought it was interesting, and I'm sure it would help some people!
@derekbanas
@derekbanas 4 жыл бұрын
I'll see what I can do. I have looked at it and it is very verbose indeed
@cl32
@cl32 4 жыл бұрын
@@derekbanas Thanks! I really appreciate your work :)
@alexandern8671
@alexandern8671 4 жыл бұрын
Thanks for another great video. It's probably me but I could not find the link to jupiter notebook you used in the video to run the examples. Could you please point me in the right direction if it is possible?
@derekbanas
@derekbanas 4 жыл бұрын
Thank you :) I show how to install everything for Windows here : kzbin.info/www/bejne/l2i8nZWkZs6efJI and for Mac here which is basically the same for Linux kzbin.info/www/bejne/aHvIoIGieMh_ha8 and at the end of my Pandas tutorial I talk about setting up virtual environments and installing libraries kzbin.info/www/bejne/hpTZpIKXnt2Inpo Sorry everything is all over the place. That is sort of the problem with trying to create a big course, while also making these learn in one videos.
@alexandern8671
@alexandern8671 4 жыл бұрын
@@derekbanas Thanks Derek for getting back to me. The video that you mentioned has a link to the Python codes that you used for the stats tutorial, but no codes for Matplotlib video that I am after. I found these on your web site www. newthinktank. com/2020/08/learn-matplotlib-one-video/ (remove spaces) where there was a link to your Github. Thanks again
@motiongraphic5145
@motiongraphic5145 3 жыл бұрын
What is the benefit of np.arrange i did not get it.😭
@elliem9548
@elliem9548 4 жыл бұрын
Hey, thanks for the video, it's so well explained. For the Time Series section, I downloaded data from 21 Aug 2019 - 21 Aug 2020. I've done all the same code but when I put in plt.plot (date_arr_np, goog_cp) I get an error and this message: 'x and y must have same first dimension, but have shapes (64,) and (253,)'. Do you know what's gone wrong or how I can fix this?
@derekbanas
@derekbanas 4 жыл бұрын
Thank you :) It is hard to say. I have all the code and the csv file here github.com/derekbanas/matplotlib Try it and make sure you don't get an error
@jaroslavkrbec582
@jaroslavkrbec582 2 жыл бұрын
@@derekbanas Same problem here, I managed to fix this example with your data, but in case of data I downloaded, it didn't work. Did you swith some other options on yahoo or something else? Anyway, thank you for your great work!
@jaroslavkrbec582
@jaroslavkrbec582 2 жыл бұрын
So I figured it out! Almost kids' joy here :) My solution was to extract the same amount of rows from downloaded material a then use it. It may not be the most elegant sulution, but it worked. goog_data = pd.read_csv('GOOG.csv') goog_data goog_data_np = goog_data.to_numpy() goog_cp = goog_data_np[:, 4] data = pd.DataFrame(goog_cp) rows = data.head(43).to_numpy() #odstranit svátky holidays = [datetime.datetime(2022, 11, 17), datetime.datetime(2022, 10, 28)] date_arr = pd.bdate_range(start='10/1/2022', end='12/4/22', freq='C', holidays=holidays) date_arr_np = date_arr.to_numpy() fig_7 = plt.figure(figsize=(8,5)) axes_7 = fig_7.add_axes([0.1, 0.1, 0.9, 0.9]) plt.plot(date_arr_np, rows)
@cutieFAIZANHASSAN
@cutieFAIZANHASSAN 3 жыл бұрын
How did he put superscript (square) in string? Please somebody tell me.
@amirnajafi206
@amirnajafi206 4 жыл бұрын
Please do the Digital humanities introduction video(s).
@derekbanas
@derekbanas 4 жыл бұрын
I'll look into it. Thank you for the request
@EcExplorer
@EcExplorer 4 жыл бұрын
It would be great if you take some time and explain the installation procedure and troubleshooting at the beginning. I am using pip install, matplotlib is installed but it is showing error in import.
@derekbanas
@derekbanas 4 жыл бұрын
In the description I have installation videos for Windows and MacOS. What error are you seeing?
@hosenmdaltaf
@hosenmdaltaf 4 жыл бұрын
Can you give the serial, where to start this series from pandas/numpy/statistics. That will be very helpful for me.
@derekbanas
@derekbanas 4 жыл бұрын
Here is my Data Science & Machine Learning Playlist in order kzbin.info/aero/PLGLfVvz_LVvQy4mkmEvtFwZGg1S38MUmn
@didierleprince6106
@didierleprince6106 4 жыл бұрын
A ton of mercis
@derekbanas
@derekbanas 4 жыл бұрын
je suis très heureux d'aider
@liamhoward2208
@liamhoward2208 4 жыл бұрын
How did you produce the superscript while typing x/x^2 for the legend?
@derekbanas
@derekbanas 4 жыл бұрын
Look for the TeX part of this tutorial
@robertovilchis6068
@robertovilchis6068 4 жыл бұрын
Hello Derek! I have a question, in the timeseries plot, when you create it you call plt.plot() instead of axes_6.plot(). Is there a difference between the two? Thanks!
@derekbanas
@derekbanas 4 жыл бұрын
Hi Roberto, You could also use axes_7.plot(date_arr_np, goog_cp) I did it that way just to show that it works either way
@robertovilchis6068
@robertovilchis6068 4 жыл бұрын
@@derekbanas Oh I see. Thanks! Great tutorial
@arpitagec9
@arpitagec9 4 жыл бұрын
Can you please cover a series on PyQt5 with Designer (Qt)?
@derekbanas
@derekbanas 4 жыл бұрын
I'll see what I can do
@arpitagec9
@arpitagec9 4 жыл бұрын
@@derekbanas Hope to see a detailed series!🤞
@theentertainmentworld3310
@theentertainmentworld3310 Жыл бұрын
Can you please provide that jupyter notebook file
@emifo6018
@emifo6018 4 жыл бұрын
How did you I will come to your page to find machine learning tutorials these days to upload these?! Thanks, I have never come back from your channel with absence.
@derekbanas
@derekbanas 4 жыл бұрын
Thank you 😁 I hope you find them useful
@sudarshankshirsagar4568
@sudarshankshirsagar4568 4 жыл бұрын
I have favour to ask you bro , Will Go deep into Descriptive Analytics along with Supervised Machine Learning? I don't get anything which My Teacher teaches and they don't put much effort in teaching us(that's sorry to say but it's true). And one thing I really like your "Machine Learning and Data Science " series and I know that there are more things to come in that series . So best of luck and i really hope that you will go as deeper as possible in this series .Best wishes with you Bro . Keep it up 👍👍💪
@derekbanas
@derekbanas 4 жыл бұрын
Thank you for the nice message :) Yes I have promised I will dedicate myself to data science, machine learning and the related maths for the rest of the year. My goal to to provide a complete learning path all at one location in order.
@sadeghsadeghy6563
@sadeghsadeghy6563 4 жыл бұрын
@Derek Banas hey derek ive watched your java tutorial and i wanna be java backend programmer what should i learn after that i mean what concept should i learn first on java ee and actually u promise me to create Spring tutorial ?
@derekbanas
@derekbanas 4 жыл бұрын
Basically everything listed in the certification is required education.oracle.com/oracle-certified-professional-java-ee-7-application-developer/trackp_900
@sadeghsadeghy6563
@sadeghsadeghy6563 4 жыл бұрын
@@derekbanas i saw that but its little a bit counfusing u know could u cover it next tutorial i know u already created a java ee but its not enough i gues can u cover java ee i really need this and o already asked u to cover Spring too if u cover these topics your gonna change my life Thanks bro
@huizhao3589
@huizhao3589 4 жыл бұрын
where is the x, y_axis when saving the figure to a file?
@derekbanas
@derekbanas 4 жыл бұрын
Increase the figure size and both will show in the file
@patricknelson7914
@patricknelson7914 4 жыл бұрын
Thanks man!
@derekbanas
@derekbanas 4 жыл бұрын
Happy to be of help :)
@taricov4662
@taricov4662 3 жыл бұрын
thanx Derek
@derekbanas
@derekbanas 3 жыл бұрын
Thank you very much :) Happy I could help
@sarmadali3338
@sarmadali3338 4 жыл бұрын
Hi Derek sir do you know any online compiler for machine learning if you Know then tell me
@derekbanas
@derekbanas 4 жыл бұрын
Sorry, but machine learning requires a pretty powerful computer. I used to use AWS which is pretty cheap up to a point.
@sarmadali3338
@sarmadali3338 4 жыл бұрын
@@derekbanas ok thanks
@nguyenchucao8264
@nguyenchucao8264 4 ай бұрын
22:00
@ThirumaleshHS1
@ThirumaleshHS1 4 жыл бұрын
Nice tutorial, next video on PyQtGraph please ?
@derekbanas
@derekbanas 4 жыл бұрын
I'll see what I can do. Seaborn is next because I'm already working on it. I have to schedule out way in advance to make videos every day.
@ThirumaleshHS1
@ThirumaleshHS1 4 жыл бұрын
Derek Banas thanks. Looking forward for the next videos. I found PyQtGraph visualisation to be faster than matplotlib especially for real time data/signals and at the same time, PyQtGraph is difficult to understand(for me :P)
@derekbanas
@derekbanas 4 жыл бұрын
I'll definitely check it out 😁 Thank you for the request
@KevinTempelx
@KevinTempelx 4 жыл бұрын
Thank you!
@derekbanas
@derekbanas 4 жыл бұрын
I'm happy you found it useful :)
Seaborn Tutorial : Seaborn Full Course
59:34
Derek Banas
Рет қаралды 208 М.
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
Matplotlib Full Python Course - Data Science Fundamentals
1:02:41
NeuralNine
Рет қаралды 165 М.
Matplotlib Crash Course
1:31:41
freeCodeCamp.org
Рет қаралды 348 М.
Transformers (how LLMs work) explained visually | DL5
27:14
3Blue1Brown
Рет қаралды 4,2 МЛН
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 88 М.
NumPy Crash Course - Complete Tutorial
1:02:44
Patrick Loeber
Рет қаралды 128 М.
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН