I have a CSV with epoch GMT timestamp at irregular intervals paired with a value. I tried reading in from the CSV but all the times are shifted to my local timezone. How do I have it just read in as-is (in GMT)? Then I would like the resample to one minute intervals, HOWEVER, I would like to be able to have it skip gaps which are larger than a user specified value. If this is not possible, is there way to resample to to one minute, but in the gaps, put in an arbitrary value like 0.0?
Data:
Time,Data
1354979750250,0.2343
1354979755250,2.3433
1354979710250,1.2343
def date_utc(s):
return parse(s, tzinfos=tzutc)
x = read_csv("time2.csv", date_parser=date_utc, converters={'Time': lambda x:datetime.fromtimestamp(int(x)/1000.)}).set_index('Time')
Convert local datetime to GMT datetime like this:
The time zone is +08 (China).
Or using 'datetime.utcfromtimestamp':