First and foremost, I'm brand new to python and quite new to coding in general.
I'm trying to have a for loop run through an array of arrays, v1, but only run the loop at specific points in v1. arg in this code is an array such as [0,9,14,36]. In my previous question, I was trying to have the code run while excluding an array such as arg, but I'm trying to do the opposite here. I tried if not any and that didn't work, as well as a few other things. Nothing has run so far. Any help would be grealy appreciated.
for numi,i in enumerate(v1): if any(v in arg for v in i): for numj,j in enumerate(v1): if any(v in arg for v in j): angle=(np.arccos(np.dot(i,j)/(np.linalg.norm(i)*np.linalg.norm(j))))*180/(np.pi) print(angle) else: continue else: continue
a sample of v1: [-2.736 -0.466 -2.248] [-3.373 -2.93 -1.288] [-0.765 -3.666 1.123] ...
Aucun commentaire:
Enregistrer un commentaire