1

can anyone help me with python? I try to define the follow function related to both variables in a loop, but I don´t get it:

x = [0.0000, 0.0125, 0.0250, 0.0500, 0.0750, 0.1000, 0.1500, 0.2000, 0.3000, 0.4000, 0.5000, 0.6000, 0.7000, 0.8000, 0.9000, 0.9500, 1.000, 0.0000, 0.0125, 0.0250, 0.0500, 0.0750, 0.1000, 0.1500, 0.2000, 0.3000, 0.4000, 0.5000, 0.6000, 0.7000, 0.8000, 0.9000, 0.9500, 1.000]
z = [0.0000, 0.0221, 0.0336, 0.0518, 0.0662, 0.0782, 0.0965, 0.1090, 0.1202, 0.1178, 0.1055, 0.0868, 0.0649, 0.0421, 0.0202, 0.0105, 0.0000, 0.0000, -0.0151, -0.0186, -0.0185 , -0.0150, -0.0113, -0.0065, -0.0026, -0.0007, -0.0011, -0.0057, -0.0114, -0.0156, -0.0165, -0.0127, -0.0087, 0.0000]

for i, j in (range(x), range(z)):
    """incluir cada valor con un indice correspondiente a la matriz"""
    l_hess=np.sqrt(i^2+j^2)
    print(l_hess)
    delta = np.arctan2(j/i)
    print(delta)
Adam Jaamour
  • 1,326
  • 1
  • 15
  • 31
  • I believe you wanted: `for i, j in zip(x, z):` – zvone Nov 04 '17 at 11:14
  • It seems that you are at the very beginnings of programming, and it's ok. My advice, however, is that you look for a basic tutorial or book, and learn from it. You will take more time for writing code, but your learning curve will be faster – Jalo Nov 04 '17 at 11:16

0 Answers0