[Numpy-discussion] determinant of a scalar not handled

Charles R Harris charlesr.harris@gmail....
Mon Jul 26 18:38:14 CDT 2010


On Mon, Jul 26, 2010 at 5:05 PM, Skipper Seabold <jsseabold@gmail.com>wrote:

> On Mon, Jul 26, 2010 at 5:48 PM, Alan G Isaac <aisaac@american.edu> wrote:
> > On 7/26/2010 12:45 PM, Skipper Seabold wrote:
> >> Right now np.linalg.det does not handle scalars or 1d (scalar) arrays.
> >
> > I don't have a real opinion on changing this, but I am curious
> > to know the use case, as the current behavior seems
>
> Use case is just so that I can have less atleast_2d's in my code,
> since checks are done in linalg.det anyway.
>
> > a) correct and b) to provide an error check.
> >
>
> Isn't the determinant defined for a scalar b such that det(b) ==
> det([b]) == det([[b]])?
>
>
Well,  no  ;)  Matrices have determinants, scalars don't. Where are you
running into a problem? Is something returning a scalar where a square array
would be more appropriate?

<snip>

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100726/d8b9b3f3/attachment.html 


More information about the NumPy-Discussion mailing list