diff --git a/Scales/test.json b/Scales/test.json index 49f0a77..21f86da 100644 --- a/Scales/test.json +++ b/Scales/test.json @@ -161,7 +161,8 @@ "P6": "I can't stand being contradicted", "P7": "I judge people by their appearance", "P8": "I am not easily annoyed", - "P9": "I try to forgive and forget" + "P9": "I try to forgive and forget", + "P10":"I have a good word for everyone." }, "reverse":[ "A8","A9","A10", @@ -179,6 +180,6 @@ "M6","M7","M8","M9","M10", "N8","N9","N10", "O6","O7","O8","O9","O10", - "P8","P9" + "P8","P9","P10" ] } \ No newline at end of file diff --git a/file_load.py b/file_load.py index 3ec6645..2cb829c 100644 --- a/file_load.py +++ b/file_load.py @@ -24,6 +24,16 @@ def batch(): # print(items) return items +def reverse_list(): + scales = os.listdir("Scales") + items=[] + for i in scales: + with open("Scales/"+i,"r") as scale: + tmp = json.load(scale) + items.extend(tmp["reverse"]) + # print(items) + return items + def old_type(str): with open(str,"r") as file: scale=json.load(file) @@ -78,12 +88,18 @@ def make_data(): def corelation(): data = pandas.read_csv("Work/data.csv") + rev=reverse_list() + print(rev) que={} for i in data: for j in data: if i!=j: try: que[i,j]=data[i].corr(data[j]) + if i in rev: + que[i,j]*=-1 + if j in rev: + que[i,j]*=-1 que[j,i]=que[i,j] except: pass