diff options
author | TAMARA JERINIC <tamara.jerinic@gmail.com> | 2022-03-14 23:22:24 +0100 |
---|---|---|
committer | TAMARA JERINIC <tamara.jerinic@gmail.com> | 2022-03-14 23:22:24 +0100 |
commit | 72005d90ce26890be13baec2435b2bf536165168 (patch) | |
tree | 36a1844a2f732ccfe5c86ce9712823bee6e29721 | |
parent | ee8bd6d858df94263953d07b8c950b0d8de41c7a (diff) |
Izmenjen je api.py fajl
-rw-r--r-- | backend/microservice/PythonServer/project/api/api.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/backend/microservice/PythonServer/project/api/api.py b/backend/microservice/PythonServer/project/api/api.py index 1f4afdeb..b2fb503b 100644 --- a/backend/microservice/PythonServer/project/api/api.py +++ b/backend/microservice/PythonServer/project/api/api.py @@ -7,7 +7,8 @@ import pandas as pd import keras import csv import json - +import mlservice +from mlservice import obuka app = flask.Flask(__name__) app.config["DEBUG"] = True @@ -20,13 +21,8 @@ def index(): @app.route('/data', methods = ['GET', 'POST']) def data(): if request.method == 'POST': - f = request.json['filepath'] - data = [] - with open(f) as file: - csvfile = csv.reader(file) - for row in csvfile: - data.append(row) - data = pd.DataFrame(data) + f = request.json['filepath'] + data = pd.read_csv(f) print(data) - return render_template('data.html', data = data.to_html(header=False, index=False)) + return obuka(data,request.json) app.run()
\ No newline at end of file |