Skip to content

Commit

Permalink
added precise_float keyword to pp_hook for loading json networks
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohmeier committed Jan 29, 2019
1 parent 42f8492 commit 5dd0887
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandapower/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ def pp_hook(d):
d[key] = pp_hook(d[key])

if class_name == 'Series':
return pd.read_json(obj, **d)
return pd.read_json(obj, precise_float=True, **d)
elif class_name == "DataFrame":
df = pd.read_json(obj, **d)
df = pd.read_json(obj, precise_float=True, **d)
try:
df.set_index(df.index.astype(numpy.int64), inplace=True)
except (ValueError, TypeError, AttributeError):
Expand Down Expand Up @@ -330,7 +330,7 @@ def json_net(obj):
def json_dataframe(obj):
logger.debug('DataFrame')
d = with_signature(obj, obj.to_json(orient='split',
default_handler=to_serializable, double_precision=14))
default_handler=to_serializable, double_precision=15))
d.update({'dtype': obj.dtypes.astype('str').to_dict(), 'orient': 'split'})
return d

Expand Down

0 comments on commit 5dd0887

Please sign in to comment.