Bernadette Elena Hammerle преди 3 години
родител
ревизия
5bbeebbbb2
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      src/evaluation/csvToJson.py

+ 4 - 2
src/evaluation/csvToJson.py

@@ -1,7 +1,9 @@
 import pandas as pd
 import json
+import os
 
-df = pd.read_csv("metrics.csv", delimiter=";")
+directory = os.path.dirname(os.path.abspath(__file__))
+df = pd.read_csv(directory + "/metrics.csv", delimiter=";")
 df = df.dropna(subset=["Metrik"]).reset_index(drop=True)
 
 catLookUp = {
@@ -44,6 +46,6 @@ for i, row in df.iterrows():
         "comments": comments
     })
 
-with open("metrics.json", "w") as jsonFile:
+with open(directory + "/metrics.json", "w") as jsonFile:
     json.dump({"metrics": metrics}, jsonFile, indent=2)