Python Pandas Dates and Times

preview_player
Показать описание
In this python tutorial, we will go over several examples of how to work with dates and times in pandas.

Рекомендации по теме
Комментарии
Автор

hello Ryan, great video, got 2 questions for you.
data looks like this
"date", "time", "open", "high", "low", "close"
04/21/82, 10:01, 528.55, 528.55, 528.45, 528.45
04/21/82, 10:03, 528.40, 528.45, 528.40, 528.45
04/21/82, 10:04, 528.40, 528.40, 528.35, 528.40
04/21/82, 10:06, 528.45, 528.45, 528.40, 528.40
I am trying to do a day HIGH/LOW studies on 1-min S&P futures data.

I have 2 questions.

1) How could I print the day HIGH / LOW for each day
2) How could I print the day HIGH / LOW for the first hour of trading
I've tried the followings:

and got this
date
1982-04-21 529.80
1982-04-22 530.60
1982-04-23 531.95
1982-04-26 532.80
I am kind of stuck here. I want to have the output displayed all in 2 lines day by day like the following.

Date, Time, High
Date, Time, Low
Could you please help ? thanks a lot in advance. I appreciate your time.
data type
date datetime64[ns]
time datetime64[ns]
open float64
high float64
low float64
close float64
dtype: object

twtw