> -----Original Message----- > From: Greg Ewing <greg.ew...@canterbury.ac.nz> > Sent: Thursday, November 26, 2020 12:01 AM > To: python-list@python.org > Subject: Re: Why can't numpy array be restored to saved value? > > On 25/11/20 7:47 pm, pjfarl...@earthlink.net wrote: > > Why isn't the final value of the numpy array npary in the following code the > > same as the initial value before some but not all elements of the array were > > changed to a new value? > > Slicing a numpy array doesn't copy anything, it just > gives you another view of the underlying data. > > This is a trap you need to watch out for, since it's > different from the way sequences normally behave in > Python. > > -- > Greg
Thank you for that explanation. I will certainly watch out for it in the future. Peter -- https://mail.python.org/mailman/listinfo/python-list