Skip to content

Commit

Permalink
replace NaN with nulls (None) in python
Browse files Browse the repository at this point in the history
NaN does not work with Browswer JSON
  • Loading branch information
salivian committed Nov 12, 2019
1 parent 300ff13 commit 476e0a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/bin/db_rest_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def data():
resp = make_response()
print(q)

data=pd.read_sql(q,engine).fillna(None)
mime
data=pd.read_sql(q,engine).replace(to_replace=float('nan'),value=None)
mime=''

if format=='json':
data = json.dumps(data.to_dict(orient='records'))
Expand Down

0 comments on commit 476e0a9

Please sign in to comment.