I'm having some problems with python 2.6 and I fount the same problem with python 3.2.2
I've never noted that before until today.
When I referenciate an array to a var and after that referenciate part of this array to another var and finely change an item of this second var, the first var have the item changed also. For instance (this is a simple exemple of shell):
Expand|Select|Wrap|Line Numbers
- >>> from numpy import *
- >>> a = arange(10)
- >>> a
- array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
- >>> b = a[:5]
- >>> b
- array([0, 1, 2, 3, 4])
- >>> b[3] = 99
- >>> b
- array([ 0, 1, 2, 99, 4])
- >>> a
- array([ 0, 1, 2, 99, 4, 5, 6, 7, 8, 9])
- >>>
I've also tried with the traditional list, and the same thing have been verified in python 26.
Is that a problem with the language logic or is that ok?
For me it's nog a good thing, because I have to control the variable progress and it won help me in that way.
2011/12/10 Bytes <support@bytes.com>
28582038