优化了计算时间

r对于i,j和j,i只计算一次
This commit is contained in:
mxr612 2024-05-15 14:25:16 +08:00
parent aa956261b8
commit 53b5c63c86

View File

@ -81,9 +81,13 @@ def corelation():
que={}
for i in data:
for j in data:
try:
que[i,j]=data[i].corr(data[j])
except:
pass
if i!=j:
try:
que[i,j]=data[i].corr(data[j])
que[j,i]=que[i,j]
except:
pass
else:
break
return que