On 2017-12-21, rafaeltfre...@gmail.com <rafaeltfre...@gmail.com> wrote:
> Dear community, I am having the following problem when I am
> assigning the elements of a vector below a certain number to
> zero or any other value. I am creating a new variable but
> Python edits the root variable. Why?
>
> import numpy as np
>
> X=np.arange(1, 10000, 1) #root variable

np.arange creates an object. The assignment makes X refer to that
object.

> x1=X 

X refers to the previous object, and then the assignment makes x1
refer to that same object.

-- 
Neil Cerutti

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to