Matplotlib Tutorial (Part 8): Plotting Time Series Data

  Рет қаралды 189,495

Corey Schafer

Corey Schafer

Күн бұрын

Пікірлер: 91
@coreyms
@coreyms 5 жыл бұрын
I hope everyone finds this video helpful. The next video of the series will be posted tomorrow at the same time. The next video will cover how to plot live data in real-time. We will learn how to monitor a CSV file for changes and add that data to our plot as it's being generated, so be sure to check that out. I'd like to thank Brilliant for sponsoring this series. If you'd like to check them out then you can sign up with this link and get 20% off your premium subscription: brilliant.org/cms
@MohitYadav-xh4tr
@MohitYadav-xh4tr 4 жыл бұрын
How can we display data on hover
@alenjose3903
@alenjose3903 4 жыл бұрын
@@MohitYadav-xh4tr use iplot
@scottandy5848
@scottandy5848 3 жыл бұрын
i know it's kinda off topic but does anyone know of a good website to stream newly released series online ?
@brodyuriel1142
@brodyuriel1142 3 жыл бұрын
@Scott Andy i would suggest Flixzone. Just search on google for it :)
@peterguillermo4513
@peterguillermo4513 3 жыл бұрын
@Brody Uriel yea, have been using flixzone for since march myself :D
@youngzproduction7498
@youngzproduction7498 5 жыл бұрын
The whole matplotlip is awesome. I keep watching them on and on.
@vijeyetasharma6193
@vijeyetasharma6193 3 жыл бұрын
its life saver hehhee Mr. Schafer love u man
@coreyms
@coreyms 5 жыл бұрын
I just realized that I'm missing a date in my CSV data. I fixed that in the snippets, so if you're following then there will no longer be a missing date in the downloaded snippets. But we can see that even with the missing date in the video, it interpolates the values for that missing date in the plot.
@dawah7556
@dawah7556 5 жыл бұрын
after this series i really want to see a short series on numpy library.. by the way i appreciate the effort that you put in your videos.. Great work keep it up..
@gustavoteixeira8295
@gustavoteixeira8295 3 жыл бұрын
'Amazing' is not enough to describe the video quality. Thank you very much.
@kalyanalladi
@kalyanalladi 5 жыл бұрын
Corey, your videos are awesome. Learning lot from these. Would like to see more videos on machine learning, neural networks as well
@francist3979
@francist3979 5 жыл бұрын
Amazing work Corey! I enjoy your videos and will be watching as many as possible! love the work!
@harvey2242
@harvey2242 4 жыл бұрын
at 12:31, a faster method to define the datetime column data = pd.read_csv(."....", parse_dates=[0]) 0 refer to the column index where the date column lies.
@suchetapathalam5693
@suchetapathalam5693 Жыл бұрын
Absolutely love how you explain evrything so clearly!!
@anibalguerrerohernandez257
@anibalguerrerohernandez257 3 жыл бұрын
Had been stuck for several days on a big data structure, but your video has helped me out. Thank you so much!
@danielalegriasallo5551
@danielalegriasallo5551 3 жыл бұрын
I'm binge watching this series, it's been so interesting to learn MatplotLib.
@muzzamilnadeem3104
@muzzamilnadeem3104 4 жыл бұрын
This is such an informative video. Really appreciate how u explained each and every thing !
@Terence818
@Terence818 4 жыл бұрын
14:00 I think even without pd.to_datetime() conversion (line 10), pd.sort_values() (line 11) will still work as expected, since treating dates as strings will still produce the same plot. Am I right?
@johangodinho
@johangodinho 4 жыл бұрын
Thank you for this amazing series. Being a fellow python creator aswell, I really appreciate the amount of effort you put into creating this amazing tutorials, and all the best for the future :))
@BarbaraBezd
@BarbaraBezd 2 жыл бұрын
Thanks for this video. It was very useful!
@rancoxu
@rancoxu 5 жыл бұрын
Thx a lot for making this series!
@anurasenarathna1703
@anurasenarathna1703 2 жыл бұрын
As usual, great series. Thank you very much.
@FawadJaved
@FawadJaved 5 жыл бұрын
error at df = pd.to_datetime(df) to assemble mappings requires at least that [year, month, day] be specified: [day,month,year] is missing. i dont have days or months or years i only have like '09:00:00.036' %H:%M:%S.%f but its given me error ... please help me .... i only want to show the given h,m,s.f .......days years and monhs are not given in dataset
@abdelrahmanali4550
@abdelrahmanali4550 3 жыл бұрын
Thanks Corey for making it look so easy.
@anubhavrauniyar3192
@anubhavrauniyar3192 2 жыл бұрын
Thank You Corey! love your Work..........
@TheBIMCoordinator
@TheBIMCoordinator 5 жыл бұрын
Great info!
@ulfgj
@ulfgj 5 жыл бұрын
- video liked - beer opened - watching video
@alenjose3903
@alenjose3903 4 жыл бұрын
Corey and Chill
@anujsharma3656
@anujsharma3656 8 ай бұрын
It took me quite a while to get it to work. 1) I had to install ffmpeg otherwise I was getting index error which was impossible to resolve . If it was not for chat gpt I could not figured out. 2) Also I had to add a frames by using reading len(data['x_value']) to animate object to make FuncAnimation being called and also updateanimate func with frames being updated during the call to be used again 3) I running jupyter notebook from vscode. I had to add %matplotlib inline. Though my plot still does not show dynamically with plt. show . I had to save the animation to file to view it getting updated dynamically.
@lovermonkey
@lovermonkey 5 ай бұрын
Question. I have a time stamp that looks like this. 2024-08-21 10:19:02.576699 When I am ready to plot, how do I take this data and reduce it down so its easy to read. Also, how do I spread those out do it doesn't, so it doesn't overlap the others being printed. thanks you advance.
@danielflorea3001
@danielflorea3001 3 жыл бұрын
Exremely useful and great explanations
@MrsDyarvane
@MrsDyarvane 2 жыл бұрын
This was helpful , thank you!
@digipak07
@digipak07 4 жыл бұрын
Excellent video. Thanks for sharing.
@dr.bhartivnathwani2073
@dr.bhartivnathwani2073 3 жыл бұрын
Nice video. How to download and save data.csv file in laptop which you shared?
@shikharsaxena9989
@shikharsaxena9989 4 жыл бұрын
the best lecture i have found on youtube. DO share some more resources
@viniciusinojosa
@viniciusinojosa 2 жыл бұрын
Hello there, nice video. Is it possible to do it in subplots?
@KillerBee1917
@KillerBee1917 4 жыл бұрын
Extremely useful, thanks a lot!
@SimpleHumanInNY
@SimpleHumanInNY 4 жыл бұрын
Folks using jupyter notebook: import datetime as dt dates = [ dt.datetime(2019, 5, 24), dt.datetime(2019, 5, 25), dt.datetime(2019, 5, 26), dt.datetime(2019, 5, 27), dt.datetime(2019, 5, 28), dt.datetime(2019, 5, 29), dt.datetime(2019, 5, 30) ]
@Andresdha
@Andresdha 5 жыл бұрын
Awesome videos! Do you plan on doing videos on Pandas? That’d be great!
@coreyms
@coreyms 5 жыл бұрын
Yes, I'll be covering Pandas next. It takes time to finish a complete series, so I'm not sure when this will be released yet, but I am working on it now.
@shreyashkashyap
@shreyashkashyap Жыл бұрын
Beneficial video. I would have mistakenly kept the dates as strings instead of datetime data. Will make sure to convert them before plotting them.
@juanventrone
@juanventrone 4 жыл бұрын
I feel that I love you!, Thanks for share all this videos bro!!
@chenliang4942
@chenliang4942 5 жыл бұрын
Thanks a lot.The series is awesome
@nickt423
@nickt423 3 жыл бұрын
@8:46 I wish you had shown that. Has anybody successfully formatted the dates in the 2nd example (as he showed in the 1st example)?
@greggreen5510
@greggreen5510 3 жыл бұрын
You can use the code in the first example to format the dates in the second example. It doesn't work unless you use the to_datetime() function on the date row.
@laurentb6563
@laurentb6563 4 жыл бұрын
This is beautiful
@bernardclark274
@bernardclark274 4 жыл бұрын
Great series. Can someone explain why only every second date is printed on the x-axis? How can the code be changed to print very day?
@AbdulRehmanappsforall
@AbdulRehmanappsforall 5 жыл бұрын
Great video as always, but how we can adjust if we have time also? Because in some datasets where the time-interval in minutes we probably have the time with date also.
@nitish145145
@nitish145145 4 жыл бұрын
You can use like this datetime(2020, 4, 27, 9, 10, 20, 43)
@microsoftmath
@microsoftmath 4 жыл бұрын
How to add percentage change from one point to another in the plot that you have shown.
@rishiraj1028
@rishiraj1028 4 жыл бұрын
If the dates are not arranged in order in your list and you use solid line...the dates will be arranged according to time, but the y values will be connecet to each other as they appeared in the list...and that will look very weird graph, having many intersecting lines
@nickm2642
@nickm2642 4 жыл бұрын
What about plotting data by date when you're just looking for how many events took place in a time frame? For example, how many customer bought x, y and z product in 2019? Or by quarter? Data sets don't always track data by date in each row like stock or coin prices.
@iyanu3723
@iyanu3723 5 жыл бұрын
please can you show how to plot multidimensional time series. i love your videos
@ghostwhowalks5623
@ghostwhowalks5623 5 жыл бұрын
excellent tut as always. Any thoughts on how to make the month lower case; as in I'd like to get "may-19" instead of "May-19". Thanks
@jackyhuang6034
@jackyhuang6034 4 жыл бұрын
Awesome tutorial. If we have many rows (too many points), how can we select only year-month and each month only needs to show once?
@abhinav9561
@abhinav9561 4 жыл бұрын
Thanks man!!
@amanrastogi1232
@amanrastogi1232 5 жыл бұрын
Awesome Video Series. I have followed all your python series and OOPs in python :) and i love those very much. I am highly interested to know what will the next chapter we are going to learn from you?
@coreyms
@coreyms 5 жыл бұрын
I’m going to cover Pandas and Numpy after this Matplotlib series. I will also release individual videos between those series’, such as multiprocessing and threading. I haven’t planned much beyond that.
@ThomasHaberkorn
@ThomasHaberkorn 3 жыл бұрын
great series of videos! One more to round it up: Is it possible to create a 'data cursor' to display the CSV values near the mouse location? would be a very useful add-on in my opinion. thanks
@yuvii007
@yuvii007 4 жыл бұрын
what about datetime? how to set ticks for date time axis
@sanjuktaghosh7855
@sanjuktaghosh7855 3 жыл бұрын
How to do with only hours? I have daily data of each hour and I need to plot for hourly timeseries
@aeroscience9834
@aeroscience9834 3 жыл бұрын
What about times all at the same date?
@slobodantajisic2762
@slobodantajisic2762 4 жыл бұрын
11: 44 We could sort the strings here, as we sort the dates later. We would get the same. We do not have a May 17th at the beginning because we didn’t sort, not because those aren’t dates. Am I right?
@lovesparkles1983
@lovesparkles1983 3 жыл бұрын
Hello, may i ask how do I just filter out for example 2019 in a column of different years and then plot it? :)
@joelmathew855
@joelmathew855 4 жыл бұрын
Hey Corey, can you tell me how I can use Timestamp in x-axis with live data so that after every plotting the time keeps moving for the respective y axis and so that the axis does not get complete. Awaiting your reply
@ashikka5902
@ashikka5902 4 жыл бұрын
Hey Corey! Thanks a lot for the videos. Could you create some more videos that cover Time Series in detail please? I have gone through the one on your channel and its great, but I guess it would be really helpful if you create more on it with examples. There's very less content that I found good related to Time-series and I'm sure your videos would solve that issue.
@anujsharma3656
@anujsharma3656 8 ай бұрын
i could not get the plot to show and had to modify writ to an image and also if I don't put frames or save_count the image does not display. Is this behaviour being seen by other as well. f = r'test_animation.gif' ani=FuncAnimation(fig1,animate,interval=1000,save_count=100) writergif = anm.PillowWriter(fps=3) ani.save(f,writer=writergif) ani.save(f,writergif) plt.tight_layout() plt.show() Image(open('test_animation.gif','rb').read())
@דניאלקרמר-ר5ה
@דניאלקרמר-ר5ה 5 жыл бұрын
How do you use the # symbol such it will either show on many lines of code AND delete all of them in a shortcut?
@suhailanjumabdurraheemsayy7639
@suhailanjumabdurraheemsayy7639 4 жыл бұрын
Thank you very much for very nice series of videos. I am following all the videos. Only in the present video it show the error about itertools. I try to install it using pip as well as conda but can't do that. the i try to install pip3 install more-itertools. it says the requirements already satisfied. but still same error. I am using Windows10 64 bit and using Spyder4 editor (comes with anaconda installation). Your kind help in this regard is highly appreciated.
@suhailanjumabdurraheemsayy7639
@suhailanjumabdurraheemsayy7639 4 жыл бұрын
Actually, there was a minute mistake (in the typing of itertools). I corrected it and got the results. Thank you, very much, Corey Schafer Sir for nice videos!!!
@CentboyMidnight
@CentboyMidnight 5 жыл бұрын
if you pass this arg parse_dates=True into the csv function. It doesn't do the trick for you?
@BiancaAguglia
@BiancaAguglia 5 жыл бұрын
I think parse_dates = True parses the index. 😊 In this video, when Corey used the read_csv function he didn't specify an index, so pandas created a simple index (just consecutive integers starting at 0). To avoid using data['Date'] = pd.to_datetime(data['Date']), there are two options when you first use pd.read_csv(): 1. Use the 'Dates' column as index, and use parse_dates = True 2. Use parse_dates = ['Dates']
@liangyumin9405
@liangyumin9405 5 жыл бұрын
Great!
@xSayllusx
@xSayllusx 5 жыл бұрын
Very nice. Is their any way to use the rest of the columns tho? Can u make a graph that includes high, low, closing value and volume? Does a graph like that even make sense? Or can u do some tips of aggregations if u had more than one currency, for instance what if u had a similar table but with euros, pounds and yuan mixed in too? Sorry for the long question :)
@coreyms
@coreyms 5 жыл бұрын
Just like with our line plots, we can plot multiple lines on these time series plots. So if you wanted more information then you could do that.
@xSayllusx
@xSayllusx 5 жыл бұрын
@@coreyms hmm whatabout a 3d graph? Is that possible?
@VJ-td6oc
@VJ-td6oc 4 жыл бұрын
What about plotting hours:minutes:seconds, i suppose that it can't be done with dates,and i need timestamp format for that?
@rishiraj1028
@rishiraj1028 4 жыл бұрын
when you zoom in to the graph....it shows the hours minues anad even seconds
@PW_Dingo
@PW_Dingo 4 жыл бұрын
what python program did u use to code this?
@seanmusse1779
@seanmusse1779 4 жыл бұрын
Do you mean his text editor? He's using sublime text
@rahulsharma-st5yg
@rahulsharma-st5yg 5 жыл бұрын
@corey: how to plot candlesticks with volume
@guanfuqiao5879
@guanfuqiao5879 4 жыл бұрын
Just come across that in pandas they have date_range function.
@josesaldanamoreno9845
@josesaldanamoreno9845 5 жыл бұрын
Could any intelligent human tell me how can I animate vectors (arrows) in Matplotlib. I've tried many different ways and they either not move the vector or Python gives an error (something like: You can not update data from vector, plt/ax.arrow). I'm a noob and I've been stuck for a while with this problem, so I would really appreciate ANY idea. Thanks
@CodeLvl
@CodeLvl 5 жыл бұрын
Sir, I need some help about Django raw queries. Please help me.
@dskeshav9038
@dskeshav9038 5 жыл бұрын
Please explain how to visualize a multi-class time series classification dataset with different DateTime formats in a single column. The time interval of the recording of each sample measurement is every 15 minutes. Please find the link to the dataset for reference -"www.hackerearth.com/problem/machine-learning/on-the-plague-trail/"
@AG-dt7we
@AG-dt7we Жыл бұрын
I guess too late to reply. While reading CSV, pd.read_csv(parse_dates=['DateTime'])
Matplotlib Tutorial (Part 9): Plotting Live Data in Real-Time
20:34
Corey Schafer
Рет қаралды 424 М.
How do I work with dates and times in pandas?
10:21
Data School
Рет қаралды 187 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Matplotlib Tutorial (Part 10): Subplots
21:22
Corey Schafer
Рет қаралды 249 М.
15 POWERFUL Python Libraries You Should Be Using
22:31
ArjanCodes
Рет қаралды 69 М.
Matplotlib Tutorial (Part 7): Scatter Plots
21:24
Corey Schafer
Рет қаралды 183 М.
Matplotlib Tutorial (Part 2): Bar Charts and Analyzing Data from CSVs
34:26
Python in Excel vs. VBA - What You Should Learn in 2024!
10:05
David Langer
Рет қаралды 79 М.
"Clean" Code, Horrible Performance
22:41
Molly Rocket
Рет қаралды 945 М.
Matplotlib Full Python Course - Data Science Fundamentals
1:02:41
NeuralNine
Рет қаралды 169 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН