(This tag is similar to other tags, but the other tags are often specific). I tried to raise it on a high level.
I initialised a varibale "X"
, type(list)
with an another varibale "arrayMetricPI"
, type(list)
. But as I change ("X"
) I also change variable ("arrayMetricPI"
), which doesn't make sense to me?
Maybe it's Python specific?
What can I do, to keep an original value of a variable unchanged (here:"arrayMetricPI"
) - even if I change the initialised variable (here: "X"
)?
print(arrayMetricPI) # returns array "[0.0, 0.01, 0.02, 0.03,...]
X = arrayMetricPI
for xx in np.arange(0, counter, 1):
# delete the first entry of the the array "X"
print(X) # returns array "[0.01, 0.02, 0.03,...]
print(arrayMetricPI) # returns array "[0.01, 0.02, 0.03,...]
I expected that arrayMetricPI
still starts with [0.0,...]
as I just changed the list "X".