linregress and polyfit

Dave Angel davea at davea.name
Wed Sep 18 15:57:26 EDT 2013


On 18/9/2013 09:38, chitturk at 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





More information about the Python-list mailing list