Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #54398

Re: linregress and polyfit

From Dave Angel <davea@davea.name>
Subject Re: linregress and polyfit
Date 2013-09-18 19:57 +0000
References <73ee6fa3-baa6-4178-8596-5f88bbd0bfa2@googlegroups.com> <f1b29ea6-b4db-4636-8042-7c531ed8e99a@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.133.1379534267.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

linregress and polyfit Krishnan <chitturk@uah.edu> - 2013-09-17 19:34 -0700
  Re: linregress and polyfit Josef Pktd <josef.pktd@gmail.com> - 2013-09-17 21:25 -0700
  Re: linregress and polyfit chitturk@uah.edu - 2013-09-18 06:38 -0700
    Re: linregress and polyfit Dave Angel <davea@davea.name> - 2013-09-18 19:57 +0000
    Re: linregress and polyfit Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-09-19 15:37 +0100
  Re: linregress and polyfit chitturk@uah.edu - 2013-09-19 04:32 -0700

csiph-web