Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #105194 > unrolled thread
| Started by | Peter Otten <__peter__@web.de> |
|---|---|
| First post | 2016-03-18 11:37 +0100 |
| Last post | 2016-03-18 11:37 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: why x is changed in the following program? Peter Otten <__peter__@web.de> - 2016-03-18 11:37 +0100
| From | Peter Otten <__peter__@web.de> |
|---|---|
| Date | 2016-03-18 11:37 +0100 |
| Subject | Re: why x is changed in the following program? |
| Message-ID | <mailman.311.1458297456.12893.python-list@python.org> |
maurice.charbit@telecom-paristech.fr wrote: > from numpy import random > x=random.randn(6) In Python > y=x doesn't make a copy, it binds y to the same object as x. From now on every modification you apply to y > y[0]=12 affects x, too, because x and y refer to the same object. > print x[0]
Back to top | Article view | comp.lang.python
csiph-web