Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'argument': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'element,': 0.16; 'function?': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tuple.': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'tells': 0.24; 'header:X-Complaints- To:1': 0.27; 'tried': 0.27; 'page.': 0.31; 'checked': 0.32; 'checking': 0.33; 'but': 0.35; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'according': 0.40; 'helps': 0.61; 'length': 0.61; 'simply': 0.61; 'first': 0.61; 'url:reference': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: linregress and polyfit Date: Wed, 18 Sep 2013 19:57:26 +0000 (UTC) References: <73ee6fa3-baa6-4178-8596-5f88bbd0bfa2@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 174.32.174.35 User-Agent: XPN/1.2.6 (Street Spirit ; Linux) 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1379534267 news.xs4all.nl 15963 [2001:888:2000:d::a6]:60072 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:54398 On 18/9/2013 09:38, chitturk@uah.edu wrote: > Thanks - that helps ... but it is puzzling because > > np.random.normal(0.0,1.0,1) returns exactly one > and when I checked the length of "z", I get 21 (as before) ... > > I don't use Numpy, so this is just a guess, plus reading one web page. According to: http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html the 3rd argument to normal should be a tuple. So if you want a single element, you should have made it (1,) As for checking the 'length of "z"' did you just use the len() function? That just tells you the first dimension. Have you tried simply printing out "z" ? -- DaveA