Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3.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; 'attribute': 0.07; 'here?': 0.09; 'instance.': 0.09; 'pixels': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'wrote': 0.14; 'numpy': 0.16; 'received:80.91.229.3': 0.16; 'received:97': 0.16; 'received:plane.gmane.org': 0.16; 'zeros': 0.16; 'shape': 0.19; 'version.': 0.19; 'starts': 0.20; 'example': 0.22; 'import': 0.22; 'versions': 0.24; 'second': 0.26; 'least': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'img': 0.31; 'probably': 0.32; 'another': 0.32; 'guess': 0.33; "can't": 0.35; 'but': 0.35; 'url:org': 0.36; 'follows:': 0.38; 'whatever': 0.38; 'to:addr :python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'is.': 0.60; 'url:reference': 0.84; 'subject::': 0.85 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re:scipy shape Date: Wed, 19 Nov 2014 02:25:16 -0500 (EST) Organization: news.gmane.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 97.73.240.63 X-Newsreader: PiaoHong.Usenet.Client.VIP:1.65 X-Archive: encrypt X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416381908 news.xs4all.nl 2891 [2001:888:2000:d::a6]:53680 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3298 X-Received-Body-CRC: 2953038789 Xref: csiph.com comp.lang.python:81026 Abdul Abdul Wrote in message: > I came across an example that starts as follows: > > from scipy.ndimage import filters > img = zeros(im.shape) > > What does the second line mean here? Is it setting the image pixels to zero? What is "shape" here? > This example is incomplete. Neither zeros nor im are defined in the python versions I have installed, and shape is an attribute of im, whatever type that is. Your example needs at least another import, probably like from numpy import zeros http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html But I can't guess what im might be, unless it's some numpy instance. The other thing missing from the example is the python version. -- DaveA