On Friday, March 18, 2016 at 3:53:58 PM UTC+5:30, maurice...@telecom-paristech.fr wrote: > from numpy import random > x=random.randn(6) > y=x > y[0]=12 > print x[0] > > > > Maurice Charbit > Emeritus Prof. > mob.: 33 (0)6 5230 1171 > tel.: 33 (0)1 4581 7178 > fax: 33 (0)1 4581 7144 > maurice.char...@telecom-paristech.fr > <mailto:maurice.char...@telecom-paristech.fr> > Adresse: > Institut Mines-Telecom, > 46, rue Barrault, 75014 Paris
http://stackoverflow.com/questions/6793872/variable-assignment-and-modification-in-python if a = 5 b = a print id(a) == id(b) >> False b = 2 print a >> 5 In this case we assigning the value to b. But in the above case, we are assigning the same object reference. Like arrays in c. -- https://mail.python.org/mailman/listinfo/python-list