How do I work with dates and times in pandas?

  Рет қаралды 186,820

Data School

Data School

Күн бұрын

Пікірлер: 428
@dataschool
@dataschool 6 жыл бұрын
Starting in pandas version 0.18.1, you can create a new datetime column directly from a DataFrame, based solely on the column names! It's a useful trick, which I explain in this video: kzbin.info/www/bejne/Y3_Fimp7bs1-rs0
@cossanfran
@cossanfran 6 жыл бұрын
Hello! I have a table with the date column. I want to group the data by month / year how do I do this?
@dikshyantthapa3367
@dikshyantthapa3367 4 жыл бұрын
I love you Bruh.. 😂.. No homo..thanks a lot!!!!
@cobbdouglas690
@cobbdouglas690 4 жыл бұрын
You've saved my job on multiple occasions sir, thank you.
@dataschool
@dataschool 4 жыл бұрын
That's awesome to hear! 🙌
@kasiditauable
@kasiditauable 4 жыл бұрын
I am an aspiring data scientist. I just found a series of your videos. Thank you for doing this for all of us. Keep doing great work!
@dataschool
@dataschool 4 жыл бұрын
Thanks for your kind words, and good luck to you!
@witotiw
@witotiw 2 жыл бұрын
2022 and you're still saving us. Thanks for the excelent content
@dataschool
@dataschool 2 жыл бұрын
You're welcome!
@goktugerce
@goktugerce 8 жыл бұрын
I was actually going to ask you about this. I started learning Pandas thanks to your video series and I feel like I learnt a lot. Thanks for all the awesome videos.
@dataschool
@dataschool 8 жыл бұрын
Wow, that's really great to hear! You're very welcome!
@goktugerce
@goktugerce 8 жыл бұрын
Actually, I still need some help. I want to create a column for "year/month" from datetime column. For example, if datetime is 2016-07-06 15:56:19, I want to map "2016-07" into a column. Of course I can get first seven characters by converting it to a string, but what is the correct way to do this? I have following the following lambda function: get_month = lambda x: '{}-{:02}'.format(x.to_datetime().year, x.to_datetime().month) my_df["year_month"] = my_df["timestamp"].map(get_month) For now, I do it like this but I am sure a better and more efficient way exists for the job. I'd be glad if you can help!
@dataschool
@dataschool 8 жыл бұрын
If your desired end result is a string (such as '2016-07'), then I think using string methods is the way to go! Perhaps something like this: ufo.Time.dt.year.astype(str).str.cat(ufo.Time.dt.month.astype(str), sep='-') However, there is probably an even simpler approach that I'm not thinking of...
@goktugerce
@goktugerce 8 жыл бұрын
Awesome. It really is simpler than what I was doing. Thanks!
@archidar1
@archidar1 6 жыл бұрын
Hi, I know its a year late, but in case you (or anyone else is interested) "pd.Series.dt.strftime" is an easy way to output dates as strings in whatever format you like. pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.dt.strftime.html#pandas.Series.dt.strftime
@Cam-p2z
@Cam-p2z 5 жыл бұрын
These are the first videos I look for when I have pandas questions.
@dataschool
@dataschool 5 жыл бұрын
Thanks!
@Martin-lv1xw
@Martin-lv1xw 4 жыл бұрын
You are naturally born to impart knowledge. Thanks for your videos br!
@dataschool
@dataschool 4 жыл бұрын
Wow, I really appreciate your kind words! 🙏
@akashmishra2661
@akashmishra2661 4 жыл бұрын
I understood each and everything in this video and it helped me alot for my project. I just want to thank the instructor.
@dataschool
@dataschool 4 жыл бұрын
Great to hear!
@oleholeynikov8659
@oleholeynikov8659 4 жыл бұрын
5 years video, but the best on KZbin!!!
@dataschool
@dataschool 4 жыл бұрын
Thanks very much for your kind words!
@boubacaramaiga4408
@boubacaramaiga4408 4 жыл бұрын
I love the way you teach, easy to follow and to understand. Many Thanks.
@dataschool
@dataschool 4 жыл бұрын
You're welcome!
@christopherclark2205
@christopherclark2205 4 жыл бұрын
Phenomenal description of working with dates and times in Pandas, very helpful.
@jsmit7730
@jsmit7730 4 жыл бұрын
I'm impressed. Simple explanations with examples. subbed and hit that bell. Thanks for the vid!
@dataschool
@dataschool 4 жыл бұрын
Awesome, thank you!
@Diachron
@Diachron 8 жыл бұрын
I've only recently stumbled onto your videos. Very clear and concise delivery. Good job!
@dataschool
@dataschool 8 жыл бұрын
Thanks so much! Glad you are enjoying them.
@senz3757
@senz3757 4 жыл бұрын
Thanks for your great video! It seems pandas.Series.dt.weekday_name is removed in pandas version 0.23.0. and one can use pandas.Series.dt.day_name() instead.
@wilmarperez4962
@wilmarperez4962 4 жыл бұрын
Thanks for the tip. Was facing the same issue!
@Vishnu_Datta_1698
@Vishnu_Datta_1698 2 жыл бұрын
Thanks a lot
@jasper8291
@jasper8291 2 жыл бұрын
Thanks :)
@aartiladdha01
@aartiladdha01 5 жыл бұрын
All your videos are worth watching. I have learned a lot about pandas just from your videos. Thanks a ton :)
@dataschool
@dataschool 5 жыл бұрын
Thanks Aarti!
@RossThompson89
@RossThompson89 4 жыл бұрын
I really enjoyed this video and your teaching style! To the point, but well explained at a nice pace. Thank you for this :)
@dataschool
@dataschool 4 жыл бұрын
Thank you so much!
@goktugerce
@goktugerce 8 жыл бұрын
For anyone who wants to convert timezones, here's how you do it. First, you need to specify which timezone the date originally belongs to. In my case, it was UTC (Coordinated Universal Time). In my DataFrame (let's call it df), I have a column named "timestamp", with type datetime. I localized the column first: timestamp_utc = df["timestamp"].dt.tz_localize("UTC") Then I overwrite the timestamp column: df["timestamp"] = timestamp_utc.dt.tz_convert("Europe/Istanbul") I hope this method is correct and it helps someone!
@dataschool
@dataschool 8 жыл бұрын
Awesome! Thanks so much for taking the time to share your code.
@SetarehFasihnia
@SetarehFasihnia 5 жыл бұрын
Hi, I just tried your code but it returned all NaT values? my original column was in datetime format and UTC + x timezone. I tried to convert it to US/Eastern time. Update: Apologies, turns out the error lies in trying to convert my 'timestamp' equivalent column into date time from object and inserting errors=coerce produced the NaT values.
@payalbhatia5244
@payalbhatia5244 6 жыл бұрын
@Data School , Mark, you are just amazing. :) You make it appear everything quite simple. My humble request is to kindle make a series on machine learning algorithms too.
@dataschool
@dataschool 6 жыл бұрын
Thanks for your kind words and your suggestion!
@cmdeckermusic
@cmdeckermusic 4 жыл бұрын
Thanks for this! You explain things very clearly and concisely.
@dataschool
@dataschool 4 жыл бұрын
Thanks!
@marco4570
@marco4570 4 жыл бұрын
That bonus is what I needed. Thank you so much!
@dataschool
@dataschool 4 жыл бұрын
You are so welcome!
@AsyraffLatiffi
@AsyraffLatiffi 6 жыл бұрын
I've been watching your videos for a while now but never got the chance to comment on it i just want to say keep up the great work! You are just awesome!
@dataschool
@dataschool 6 жыл бұрын
Thanks very much for your kind words! Much appreciated :)
@aakashvarma9960
@aakashvarma9960 8 жыл бұрын
Excellent explanation .I suggested these video series to most of my friends.
@dataschool
@dataschool 8 жыл бұрын
Thanks so much! I really appreciate you spreading the word.
@deepakpanigrahi9601
@deepakpanigrahi9601 5 жыл бұрын
Data School is the best of all resource available on Pandas. thanks a ton!!
@dataschool
@dataschool 5 жыл бұрын
Thanks!
@termica7349
@termica7349 2 жыл бұрын
Thnks for this explanation buddy! So clear and concise!
@dataschool
@dataschool 2 жыл бұрын
Thanks for your kind words!
@gurkanyesilyurt4461
@gurkanyesilyurt4461 3 жыл бұрын
You're king of this area man!!!!
@dataschool
@dataschool 3 жыл бұрын
Thank you!
@pranavmendiratta3166
@pranavmendiratta3166 4 жыл бұрын
loved the tutorial, cleared my doubts! I like how you explain so patiently.
@ΠαναγιώταΜωραΐτη-τ2μ
@ΠαναγιώταΜωραΐτη-τ2μ 3 жыл бұрын
So many great videos . Absolutely guidness. thanks from GREECE !
@dataschool
@dataschool 3 жыл бұрын
Thank you!
@jannahawkins865
@jannahawkins865 2 жыл бұрын
This is a great video. Thank you so much! Also, I wish the pandas API reference still looked like it does in this older video. It's harder to read now.
@dataschool
@dataschool 2 жыл бұрын
I agree...
@slavaslavia4085
@slavaslavia4085 6 жыл бұрын
New to Pandas, new to your channel, and soon New year =) Thanks for the videos!
@dataschool
@dataschool 6 жыл бұрын
You're very welcome!
@SatishKumar-yz4tn
@SatishKumar-yz4tn 4 жыл бұрын
Thank you so much in taking time to explain so nicely.
@dataschool
@dataschool 4 жыл бұрын
You're very welcome!
@rodrigoviverosphoto
@rodrigoviverosphoto 5 жыл бұрын
This is EXACTLY was a looking for. I love you.
@dataschool
@dataschool 5 жыл бұрын
Awesome!
@nowyouknow2249
@nowyouknow2249 5 жыл бұрын
Thanks so much. You are one of the best teachers I have ever known. Thanks so much once more you are a darling.
@dataschool
@dataschool 5 жыл бұрын
Wow! Thank you so much for your kind words! :)
@samcathcart5388
@samcathcart5388 4 жыл бұрын
Hi DataSchool tk u for gr8 vid on working with dates and times. I am trying to work out how to group data for days, months and years in the same plot, e.g. bar graphs for months and different colours for the years
@shilpikulshrestha9487
@shilpikulshrestha9487 5 жыл бұрын
Hello sir, you are awesome teacher. Great videos Thank you very much
@dataschool
@dataschool 5 жыл бұрын
Thanks so much for your kind words!
@gustavoviana1178
@gustavoviana1178 5 жыл бұрын
I'm so thankful for your tutorials
@dataschool
@dataschool 5 жыл бұрын
You're welcome!
@debashissahoo5031
@debashissahoo5031 6 жыл бұрын
Your video is really good, we'll be really helpful, if you make some more videos on Dates and Times. Thank you.
@dataschool
@dataschool 6 жыл бұрын
I cover it a bit more in this series: kzbin.info/aero/PL5-da3qGB5IBITZj_dYSFqnd_15JgqwA6
@debashissahoo5031
@debashissahoo5031 6 жыл бұрын
thank you, Now I am planning to cover this series too.
@VijayKumar-zx5bm
@VijayKumar-zx5bm 8 жыл бұрын
Excellent videos.Please consider giving tutorials on time series forecasting ( with various statistical models ) with Pandas.
@dataschool
@dataschool 8 жыл бұрын
Thanks for the suggestion! I'll consider it for the future.
@leandrorberto
@leandrorberto 2 жыл бұрын
Excellent class! As always! Cheers!
@dataschool
@dataschool Жыл бұрын
Thank you!
@sinabaghaei3504
@sinabaghaei3504 3 жыл бұрын
Special thanks for your valuable work. Is the attribute "weekday_name" in panda version '1.1.3' now deprecated? and instead now we have 'day_name()' method?
@benjerome9738
@benjerome9738 4 жыл бұрын
I have a column containing times in the format hour, minute, second (e.g. 00:24:43) and are currently an 'object' type. How can I calculate the average time for this column? I have tried converting to a pandas datetime but this throws up several different errors when I try to calculate the mean? Also, I have three separate groups (full match, T1 and T2) how can I use groupby to figure out the mean times for each group? Thanks
@raghwendranarayanshandilya4525
@raghwendranarayanshandilya4525 4 жыл бұрын
Hi, I liked your way of presentation. It is very precise and nice. I would like to see any tutorial where you explain about taking statistics (mean, median, etc.) of data by filtering any column (say date-time column).
@deepakebenezer2089
@deepakebenezer2089 4 жыл бұрын
Hi - qq - I have an excel sheet that has a column that includes dates, some of the dates have errors like '4/4/4/2020' or '/1/12/2020' - - is there a way python generate a dateframe column that lists all of these errors with their corresponding row information?
@ganwilliam43
@ganwilliam43 7 жыл бұрын
Very good video tutorials! Very much thanks, Kevin.
@dataschool
@dataschool 7 жыл бұрын
You're very welcome!
@annakornikova1119
@annakornikova1119 6 жыл бұрын
Very nice, just what I was looking for . Thanks!
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@farzanaislamadiba7987
@farzanaislamadiba7987 4 жыл бұрын
Hi, I have applied the format as you had shown. But I am getting error called "AttributeError: 'DataFrame' object has no attribute 'Time'". Time is the column for my Date and time. How to solve it?
@iubob98
@iubob98 3 жыл бұрын
wow.. you're tutorials are just so awesome !!!!!
@dataschool
@dataschool 3 жыл бұрын
Thank you!
@majidm4215
@majidm4215 4 жыл бұрын
Hello , I have a dataset with datatime index col. and it is weekly data , do I need to set freq='W' to apply forecasting models such as Holt-Winters, I tried : df.index.freq ='W', and got this error: OverflowError: int too big to convert"" please help me to fix this. Thank you
@АлексейВереник-г1р
@АлексейВереник-г1р 4 жыл бұрын
Great job, bro! Thnx dude!
@dataschool
@dataschool 4 жыл бұрын
You're welcome!
@riderblack6401
@riderblack6401 6 жыл бұрын
Big thanks, Kevin! Great job!
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@vaishnavipadala9457
@vaishnavipadala9457 7 жыл бұрын
Hi, Very useful basics covered in your videos, thank you very much!
@dataschool
@dataschool 7 жыл бұрын
You're very welcome!
@j4y0785
@j4y0785 4 жыл бұрын
Hi Data School, Just a quick question, I am still new at this and my apologies if this question as been answered already, how would I go about changing multiple columns to datetime? Thank you.
@AnalyticsMaster
@AnalyticsMaster 7 жыл бұрын
Hi Kevin, Just like we have 'weekday_name' to know whether it is 'Sunday', 'Monday' etc... what should we use to find the 'month name' ? I serched for help in pandas doc, but not able to find. Kindly suggest.
@dataschool
@dataschool 7 жыл бұрын
Great question! I'm not sure if there is a built-in way in pandas to do this. I would probably write my own code to do this using the map method, explained here: kzbin.info/www/bejne/hpDUYaehjtapic0
@francescopallottino4201
@francescopallottino4201 6 жыл бұрын
you are my new hero!
@dataschool
@dataschool 6 жыл бұрын
Ha! Thanks for your kind comment :)
@carloseduardocorreacoimbra4040
@carloseduardocorreacoimbra4040 2 жыл бұрын
Kevin, could we define a ts_min and ts_max, and select the events during this interval?
@myselfandpesit
@myselfandpesit 4 жыл бұрын
Thanks for the tutorial. I have a question. How can i find unique items under a given column as some could have been repeated?
@retrofutur1st
@retrofutur1st 3 жыл бұрын
thank you for this, I have a lot to learn
@dataschool
@dataschool 3 жыл бұрын
You're welcome!
@XinhLe
@XinhLe 2 жыл бұрын
4:25 .weekday_name is not working, used day_name() instead (2022 update). Thank u!
@dataschool
@dataschool 2 жыл бұрын
Thanks for sharing!
@legiegrieve99
@legiegrieve99 7 жыл бұрын
Exactly what I wanted!! Thanks.
@dataschool
@dataschool 7 жыл бұрын
You're welcome!
@robotinthebrain
@robotinthebrain 6 жыл бұрын
You made my day, thank you
@dataschool
@dataschool 6 жыл бұрын
You're very welcome!
@subasishbiswal3481
@subasishbiswal3481 4 жыл бұрын
Hi , I have a column in date/mm/yy i want to remove the yy can i do this ?
@kirahman2
@kirahman2 4 жыл бұрын
thank you so much for this video, it saved me so much time, thank you. Wow. so good.
@devanshukala626
@devanshukala626 4 жыл бұрын
I want to show the week of months as per the datetime columns. How can i do that? Please advise.
@jessicas2978
@jessicas2978 8 жыл бұрын
I hope you could add some time series data mining analysis for us in the future. I really want to know how to mine time series data in Panda. Thank you very much!
@dataschool
@dataschool 8 жыл бұрын
Thanks for the suggestion, I'll consider it for the future!
@nadie7480
@nadie7480 3 жыл бұрын
How can I export this "datetime64" (YYYY-MM-DD HH:MM:SS) to a CSV file with the format "DD/MM/YYYY HH:MM" ?
@HealthyFoodBae_
@HealthyFoodBae_ 4 жыл бұрын
Hello, I have 2 large datasets and want to compare time differences by seconds for instance. I want to Group-by a certain column first, and then see the time differences or duration for a certain action. Can I do this in Python
@dataschool
@dataschool 4 жыл бұрын
I'm sure you can, but it's hard for me to say how off-hand. Sorry!
@anilkushwaha7164
@anilkushwaha7164 4 жыл бұрын
Please make a video for Cleaning of "FINANCIAL DATA " Your Tutorial is very Lucid and informative
@dataschool
@dataschool 4 жыл бұрын
Thanks for your suggestion!
@anilsangani8862
@anilsangani8862 4 жыл бұрын
AB['Date']=pd.to_datetime(AB.Date) i am getting error Unknown string format: TOTAL my format is dd/mm/yyyy in column Date of a data frame named AB showing dtype as object .
@u0000-u2x
@u0000-u2x 8 жыл бұрын
DataFrame.resample() is also a very, very useful feature in Pandas for working with time series.
@dataschool
@dataschool 8 жыл бұрын
Agreed!
@TorIvanBoine
@TorIvanBoine 5 жыл бұрын
awesome videos. been watching quite a few now. So, I'm playing with my gpx running data. And I'm trying to convert the duration of my runs so I can plot them. But I just fail. How would you convert ints like 33:28 and 01:44:42 so it would be understood as 33 minutes and 1 hour 44 minutes and so on?
@dataschool
@dataschool 5 жыл бұрын
Glad you like the videos! As for your question, it seems like extracting the datetime attributes (hours, minutes, seconds) and then doing the math with those attributes would solve your problem. Hope that helps!
@prof_albert
@prof_albert 2 жыл бұрын
Bravo man, really really useful. 👌💞🤩💪
@dataschool
@dataschool 2 жыл бұрын
Thank you!
@metwill
@metwill 2 жыл бұрын
Thanks, needed just this!
@dataschool
@dataschool 2 жыл бұрын
You're welcome!
@metingercek
@metingercek 5 жыл бұрын
I wrote this code after this video date = input("Input your birthday:") dt = pd.to_datetime(date) today = pd.to_datetime('today') day = today - dt print("After you born", day," hours passed")
@dataschool
@dataschool 4 жыл бұрын
Cool!
@ranaalameedee9762
@ranaalameedee9762 6 жыл бұрын
Thank you so much, wonderful explanation
@dataschool
@dataschool 6 жыл бұрын
You're welcome!
@Skandawin78
@Skandawin78 3 жыл бұрын
Python is really not intuitive when compared to R.. datetime comparison makes me split my hair . Still try to figure out how to compare a date in a dataframe ( which in datetime format) to today's date and do some action if they both match.. Any help is appreciated
@dembobademboba6924
@dembobademboba6924 Жыл бұрын
Very helpful. Thank you so much bro
@dataschool
@dataschool 10 ай бұрын
You're welcome!
@vimultivi
@vimultivi 7 жыл бұрын
hi in the last line graph what to do to introduce line with arrow after 1960 to point some annotations and also customise x axis labels ? I want to know more about axis ticks ,labels and formating of axis as per our coveinence and also annotations in graphs .Your teaching is very simple and easy to understand and interesting !
@dataschool
@dataschool 7 жыл бұрын
You'll need to use matplotlib for customizations. This post should help you get started: pbpython.com/effective-matplotlib.html
@akahn8311
@akahn8311 4 жыл бұрын
thanks for the tutorial. is there any way to change the year column meaning change the year series. In year series - starts with 1930 and then go on till 1933, how to change this to 2013 to 2016 in the csv file ? thanks lot for the time and help ! cheers
@sebastianplazaponte6766
@sebastianplazaponte6766 5 жыл бұрын
How do i subtract dates? I need to get a range between my last date time and 6 months before. Thanks! Your videos are great.
@dataschool
@dataschool 4 жыл бұрын
I'm not sure off-hand, sorry!
@balavkrish
@balavkrish 4 жыл бұрын
Thank you for the input
@dataschool
@dataschool 4 жыл бұрын
You're welcome!
@timpinckney
@timpinckney 6 жыл бұрын
Great explanation Kevin. Do you have any videos exclusively on matplotlib?
@dataschool
@dataschool 6 жыл бұрын
I don't... sorry! I'll consider them for the future!
@timpinckney
@timpinckney 6 жыл бұрын
Thanks Kevin
@sarikadatta3706
@sarikadatta3706 2 жыл бұрын
this is an awesome video but the to_datetime is not working for me, it keeps giving me error like "hour must be in 0..23: 10/11/2006 24:00" I've tried everything
@deutschejar
@deutschejar 4 жыл бұрын
Nice video man, in 9:20 min, if you wanna group by month and year, how could you do that?
@Yagnik_Sojitra
@Yagnik_Sojitra 4 жыл бұрын
I am plotting a chart in that I need to show time only, how to trim time from pandas datetime ?
@_AbUser
@_AbUser 4 жыл бұрын
I did't get what is the difference between ufo.time* and ufo.time.dt* operations. Would You explain plz...
@rahulkambadur147
@rahulkambadur147 6 жыл бұрын
Hello, In My date column has the date of month missing. how do I add the date to the existing column Ex: My column is 04-1982 (which is not in date format) and I want to make it 30-04-1982.. and want to repeat for all the other sections.. please help. and how to add a date if there is no date available
@dataschool
@dataschool 6 жыл бұрын
I'm sure there's a string method that can help: kzbin.info/www/bejne/mKDJknZmfsieftE&index=12&list=PL5-da3qGB5ICCsgW1MxlZ0Hq8LL5U3u9y
@NirajSingh-nv2jb
@NirajSingh-nv2jb 5 жыл бұрын
Great Sir. And please dont says to like videos our hands automatically get clicked on like after watching this.
@dataschool
@dataschool 5 жыл бұрын
Ha! :)
@somnathmalik7200
@somnathmalik7200 3 жыл бұрын
Thank you, it helped a lot
@varshadevgankar8242
@varshadevgankar8242 4 жыл бұрын
hi, i want a function in python that identify which column have date in them??
@manishsharma2211
@manishsharma2211 4 жыл бұрын
You are gem bro. Thank you
@dataschool
@dataschool 4 жыл бұрын
Thank you!
@teklehaimanotaman3150
@teklehaimanotaman3150 3 жыл бұрын
Hi Kevin, lets say you have a date column containing only hour, minute and second. While changing into date format using pd.to_datetime, it added automatically years and days. How could keep only hours, minutes and seconds? Thank you.
@dataschool
@dataschool 3 жыл бұрын
Great question! I can't remember off-hand, but I think you need to use a pandas timedelta object instead of a datetime object.
@udaykiran-rh8es
@udaykiran-rh8es Жыл бұрын
could you please make videos on Matplotlib ,seaborn and power bi also for data analysis . I like your way of teaching.
@dataschool
@dataschool Жыл бұрын
Thanks for your suggestion!
@udaykiran-rh8es
@udaykiran-rh8es Жыл бұрын
@@dataschool EDA also
@nousername2520
@nousername2520 4 жыл бұрын
@Data School Do you have any video on how to fill missing dates with zero (desired number) in a large csv file?
@dataschool
@dataschool 4 жыл бұрын
kzbin.info/www/bejne/nHSwo4KVi9-Ygpo
@robertowbatista
@robertowbatista 6 жыл бұрын
Thanks for the video. Quick question: How can I change the ​data type of several columns at the same time?
@dataschool
@dataschool 6 жыл бұрын
Great question! See part 3 of this video: kzbin.info/www/bejne/Y3_Fimp7bs1-rs0
@monica-ww8gi
@monica-ww8gi 5 жыл бұрын
THANK YOU! Very helpful video!! :)
@dataschool
@dataschool 5 жыл бұрын
You're very welcome! :)
@hiteshkumavat6335
@hiteshkumavat6335 5 жыл бұрын
The videos is with very nice explanation .I am getting the time data only in hour:min:sec format and when i convert it from object to time then it gives also the current date with time stamp. I want to fill the missing seconds values so is there any other function available ?
@dataschool
@dataschool 5 жыл бұрын
I'm not sure off-hand, I'm sorry!
@ariramkilowan8051
@ariramkilowan8051 8 жыл бұрын
As always (literally), Great video! Quick question, Is it trivial to combine the times from two independent time series' then resample both time series' (the data at those times) to the new combined times? I can't quite figure out how to do this pythonically. pandas.resample doesn't seem to be too friendly when using irregular timestamps.
@dataschool
@dataschool 8 жыл бұрын
Thanks for your kind comment! Regarding your question, it's hard for me to envision exactly how to do this... I'm sorry! Feel free to let me know if you figure out a good strategy.
@sdoken
@sdoken 6 жыл бұрын
It is interesting that while ufo.dtypes tells you the type as “datetime64[ns]”, when you look at each element individually type(ufo.loc[0, ‘Time’]) returns a Timestamp object. Seems a bit inconsistent? No big deal, I’ll just have to get used to it. With timedelta however, both the column and the individual elements are of type timedelta.
@dataschool
@dataschool 6 жыл бұрын
Yes, it takes some getting used to.... datetime is the type of the Series, timestamp is the type of the element, and timedelta is the type of a time range!
@enian82
@enian82 8 жыл бұрын
For some reason This through s an error ufo.Time.dt.weekday_name but ufo.Time.dt.weekday this works any idea.... Thank you
@yop1001
@yop1001 6 жыл бұрын
Love this course as usual. Thank you. I have a question. How could I do to "aggregate" rows by month or days ? (each row is a sell of a product over years)
@yop1001
@yop1001 6 жыл бұрын
Note to myself : use resample and learn to read comments (df3 = data.resample('M', on='date').sum())
@pradeepmada7515
@pradeepmada7515 3 жыл бұрын
when i am trying to convert my data column into datetype its showing an error unknown string format
How do I find and remove duplicate rows in pandas?
9:48
Data School
Рет қаралды 107 М.
How do I select multiple rows and columns from a pandas DataFrame?
21:47
How do I use the MultiIndex in pandas?
25:01
Data School
Рет қаралды 175 М.
Python for Data Analysis: Dealing With Dates
11:05
DataDaft
Рет қаралды 11 М.
Merging DataFrames in Pandas | Python Pandas Tutorials
22:09
Alex The Analyst
Рет қаралды 115 М.
My top 25 pandas tricks
27:38
Data School
Рет қаралды 270 М.
How do I make my pandas DataFrame smaller and faster?
19:06
Data School
Рет қаралды 67 М.
How do I avoid a SettingWithCopyWarning in pandas?
13:30
Data School
Рет қаралды 44 М.
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
Rob Mulla
Рет қаралды 275 М.
How do I merge DataFrames in pandas?
21:49
Data School
Рет қаралды 159 М.
Exploratory Data Analysis with Pandas Python
40:22
Rob Mulla
Рет қаралды 498 М.