Implicitly defined functions in python are confusing me.
I have a dict
cluster={"coords":set([i,j]), "var2":x[i]<0.05 or x[j]<0.05, "var3":x[i]>0.95 or x[j]>0.95, "var4":v4}
[previously dict={"var1":set([i,j]), "var2":x[i]<0.05 or x[j]<0.05, "var3":x[i]>0.95 or x[j]>0.95, "var4":v4}] changed variables to make it clear
So the next line of code reduces certain redundant [i,j]
coords to an empty set so that coords = {}
. I am having trouble then removing the "cluster" entries with coords = {}
, so that only "cluster" elements with elements in cluster
exist (basically filter out the empty ones by the value of coords).
I'm using python 2.7 so the dict list doesn't work for me.