Commit 74b8c483 authored by Martin Schrön's avatar Martin Schrön
Browse files

Reading csv can now identify time zones properly and converts to UTC

parent 2a50c852
......@@ -679,8 +679,13 @@ def make_pandas(datastr, columns=None, header_skip=0, index=1,
## Convert all the regular columns to numeric and drop any failures
data = data.apply(pd.to_numeric, errors='coerce')
## Sort and unify the index and set the time zone as UTC
data = data.sort_index().drop_duplicates().tz_localize('UTC')
## Sort and unify the index
data = data.sort_index().drop_duplicates()
# and set the time zone as UTC
if data.index.tzinfo is None: # or d.tzinfo.utcoffset(d) is None
data = data.tz_localize('UTC')
else:
data = data.tz_convert('UTC')
#print(data.head(3))
#print(data.index.dtype)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment