Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.052 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.01; 'cc:addr:python-list': 0.11; 'direct,': 0.16; 'none]': 0.16; 'numpy': 0.16; 'subject:array': 0.16; 'wrote:': 0.18; 'meant': 0.20; 'command': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'sorry,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'received:84': 0.35; 'there': 0.35; 'two': 0.37; 'expression': 0.60; 'content-disposition:inline': 0.62; 'received:82.223': 0.84; 'mr.': 0.98 Date: Fri, 20 Mar 2015 14:14:11 +0100 From: Manolo =?iso-8859-1?Q?Mart=EDnez?= To: "Mr. Twister" Cc: python-list@python.org Subject: Re: numpy array product driving me mad References: <20150320131145.GA23176@beagle> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150320131145.GA23176@beagle> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1426857853 news.xs4all.nl 2963 [2001:888:2000:d::a6]:45074 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87777 On 03/20/15 at 02:11pm, Manolo Martínez wrote: > On 03/20/15 at 01:46pm, Mr. Twister wrote: > > > I have two numpy arrays: [...] > > Is there a direct, single expression command to get this result? > > I think that you want > > P * R[;,None] Sorry, I meant P * R[:, None] Manolo