I'm writing a Python script as part of research on climate change and forest fires. This may be a novice question, but I am a beginner programmer. I have large numpy arrays (1) of meteorological variables (for instance: temperature, relative humidity, etc). In one part of the program, I define another array ('t0') to be equal to 'temp.' (2)
(1) `temp = N.array([[[-7.060185]],[[-17.5462963]],[[-22.43055556]],[[-16.13425926]]])`
(2) `t0 = temp`
(3) `t0[t0 < (-1.1)] = -1.1`
This works--- 't0' is equal to 'temp' array, but after the third line (3) 'temp' has been saved over with the new values of 't0.' Is there any way to allow 'temp' to not be changed? I have tried saving other copies, etc but nothing has seemed to work.
Thanks!
t0 = temp
, you're binding a new namet0
to the same object (in this case a numpy array)