python 2.7 compatibility

This commit is contained in:
Walker Waylon Scott 2017-05-19 21:39:07 -05:00
parent f0d4ba986d
commit fe101be5d8

View file

@ -33,7 +33,7 @@ def index():
@app.route('/data/<string:nation>') @app.route('/data/<string:nation>')
def data(nation): def data(nation):
data = '{' + f'labels:{df2.index.astype(int).tolist()}, series: {df2[nation].astype(float).tolist()}' + '}' data = '{' + 'labels:{}, series: {}'.format(df2.index.astype(int).tolist(), df2[nation].astype(float).tolist()) + '}'
return jsonify({'results':df2[nation].astype(float).tolist(), 'labels':df2.index.astype(float).tolist()}) return jsonify({'results':df2[nation].astype(float).tolist(), 'labels':df2.index.astype(float).tolist()})
if __name__ == '__main__': if __name__ == '__main__':