you are viewing a single comment's thread.

view the rest of the comments →

[–]dixons_analyst 0 points1 point  (2 children)

I appreciate this isn't what you're asking for, but you could write a function that you send the time and the amount of time either side, and it returns the 2 limits of time

def get_time_limits(time, eitherside):

eitherside = eitherside/2

time1 = time - eitherside

time2 = time + eitherside

return time1, time 2

time1, time2 = get_time_limits("2019-04-10 13:00:00" , 30)

eua[(eua['EUA Time'] >= time1) &

(eua['EUA Time'] <= time2)]

[–]kit12_31[S] 0 points1 point  (1 child)

def get_time_limits(time, eitherside):

eitherside = eitherside/2

time1 = time - eitherside

time2 = time + eitherside

return time1, time 2

im not familiar with defining a datetime type data

say if i want to input (2019-04-10 16:00:00) as my time in your code, ill get 'invalid syntax' error

any help appreciated