I want to substract a number from an array in python but I want to keep the original array.
Here's my code:
for X0 in [X0 * 0.01 for X0 in range(-2,2)]:
for Y0 in [Y0 * 0.01 for Y0 in range(6,10)]:
RAm = RA
Decm = Dec
RAm[:] = [x - X0 for x in RAm]
Decm[:] = [x - Y0 for x in Decm]
RAs = np.sum(RAm)
Decs = np.sum(Decm)
#a = np.sqrt(((RAs**2*Decs**2)**2 - RAs**4*Decs**4)/(RAs**2*Decs**2*Decs**2 -Decs**2*RAs**4))
#b = np.sqrt(((RAs**2*Decs**2)**2 - RAs**4*Decs**4)/(RAs**2*Decs**2*RAs**2 - RAs**2*Decs**4))
print RA
print RAm
This gives me that RA is changing even though it should stay the same because I want to substract a different number from RA each loop. How can I fix this?
numpy.arrays with regularlists? If so, why?