Commit 08fb8b99 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

util: give a `tzaware` option to fromjson

This will yield an utc-based time index.
parent 7e1a68e35d92
......@@ -63,8 +63,11 @@ def tojson(ts, precision=1e-14):
double_precision=-int(math.log10(precision)))
def fromjson(jsonb, tsname):
return _fromjson(jsonb, tsname).fillna(value=np.nan)
def fromjson(jsonb, tsname, tzaware=False):
series = _fromjson(jsonb, tsname).fillna(value=np.nan)
if tzaware:
series.index = series.index.tz_localize('utc')
return series
def _fromjson(jsonb, tsname):
......
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