Skip to content

Commit

Permalink
api update
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpeedX committed Mar 20, 2020
1 parent 2990788 commit 137437b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions create_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def fetch_total():
cur.execute('''SELECT cases,cured,death FROM report; ''')
data=cur.fetchall()[0]
try:
return {"cases":data[0],"cured":data[1],"death":data[2]}
return {"cases":data[0],"cured":data[1],"death":data[2],"hospitalized":(int(data[0])-int(data[1])-int(data[2]))}
except:
return {"cases":0,"cured":0,"death":0}
return {"cases":0,"cured":0,"death":0,"hospitalized":0}
def predict(state):
conn=create_connection(database)
lcases=fetch_state(state)['cases']
Expand Down

0 comments on commit 137437b

Please sign in to comment.