Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'slices': 0.07; 'terry': 0.07; 'python': 0.08; 'array.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'underlying': 0.09; 'pm,': 0.10; 'wrote:': 0.14; 'enigma': 0.16; 'extensible': 0.16; 'kern': 0.16; 'numpy': 0.16; 'received:216.62': 0.16; 'received:216.62.213': 0.16; 'received:enthought.com': 0.16; 'reedy': 0.16; 'header:In- Reply-To:1': 0.21; 'memory': 0.22; 'worst': 0.23; 'values': 0.25; 'subject:data': 0.26; 'interpret': 0.29; 'arrays': 0.30; 'semantics': 0.30; "can't": 0.32; 'header:X-Complaints-To:1': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'operations': 0.33; 'header:User-Agent:1': 0.35; 'similar': 0.37; 'change': 0.37; 'ways': 0.37; 'received:org': 0.38; 'though': 0.38; 'subject:: ': 0.38; 'attempt': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'really': 0.40; 'world': 0.63; 'our': 0.63; 'view': 0.66; 'believe': 0.66; 'us.': 0.69; '12:20': 0.84; 'underneath': 0.84; 'eco': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: data type and logarithm Date: Thu, 16 Jun 2011 16:21:56 -0500 Organization: The Church of Last Thursday References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: outbound.enthought.com User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308259331 news.xs4all.nl 49048 [::ffff:82.94.164.166]:52565 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7768 On 6/16/11 12:20 PM, Terry Reedy wrote: > rho = mp.append(rho, float(r)) # same with entropy) > > does numpy really not let you write Python stype > > rho.append(float(r)) > ? No. numpy arrays are not extensible in-place in general because we use view semantics for slices and similar operations like transpositions. We can't have the underlying memory change out from underneath us. This is one of the worst ways to accumulate values into a numpy array. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco