Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!newsfeed.datemas.de!news.datemas.de!.POSTED!not-for-mail From: Paul Appleby Newsgroups: comp.lang.python Subject: Re: So what's happening here? Date: Fri, 5 Jun 2015 13:11:13 +0000 (UTC) Organization: Datemas.de http://www.news.datemas.de Lines: 13 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: zR7O6ZVM4r/0x34XSTJ/MvQuwDhSHygo7Gzg7HH/LeugIonXd7baNro26zN80UcpuF7vksWpnn8hvetnsT6tDU829vgsVCaTaRVGaHSbAwmnmR0N2+BkCbG3IXnJyZXiWYNwE1hNq4arnLgp3yRnnO51Au/31YGZHnjlfcj4MQI= X-Complaints-To: abuse@datemas.de NNTP-Posting-Date: Fri, 5 Jun 2015 13:11:13 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com comp.lang.python:92142 On Fri, 05 Jun 2015 14:55:11 +0200, Todd wrote: > Numpy arrays are not lists, they are numpy arrays. They are two > different data types with different behaviors. In lists, slicing is a > copy. In numpy arrays, it is a view (a data structure representing some > part of another data structure). You need to explicitly copy the numpy > array using the "copy" method to get a copy rather than a view: OK, thanks. I see. (I'd have thought that id(a[1]) and id(b[1]) would be the same if they were the same element via different "views", but the id's seem to change according to rules that I can't fathom.)