[SciPy-Dev] better signature for stats.linregress
josef.pktd at gmail.com
josef.pktd at gmail.com
Thu Jul 15 12:37:06 EDT 2010
On Thu, Jul 15, 2010 at 11:34 AM, Ralf Gommers
<ralf.gommers at googlemail.com> wrote:
> The current linregress signature is (*args) which is not very informative,
> as pointed out in http://projects.scipy.org/scipy/ticket/1164. I propose to
> change it to (x, y=None), which doesn't break any code. Changes and tests
> are here: http://github.com/rgommers/scipy/commits/linregress-signature.
>
> Does this look OK?
looks good to me
2381 + if x.shape[0] == 2:
2382 + y = x[1, :]
2383 + x = x[0, :]
2384 + elif x.shape[1] == 2:
2385 + y = x[:, 1]
2386 + x = x[:, 0]
could use tuple unpacking instead, works with arrays
x,y = x
and
x,y = x.T
Thanks,
Josef
>
> Ralf
>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
More information about the SciPy-Dev
mailing list