[Numpy-discussion] problem: I get an array that doesn't have a length

Pierre GM pgmdevlist at gmail.com
Wed May 2 11:47:43 EDT 2007


On Wednesday 02 May 2007 11:39:29 Francesc Altet wrote:
> El dc 02 de 05 del 2007 a les 09:52 -0400, en/na Pierre GM va escriure:
> > In your example:
> > > >>> b = asarray(3,'d')
> >
> > b is really a numpy scalar, so it doesn't have a length. But it does have
> > a size (1) and a ndim (0).
>
> Just one correction in terms of the current naming convention: b in this
> case is a 0-dim array, which is a different beast than a numpy scalar
> (although they behaves pretty similarly).

Quite true, my bad.



More information about the NumPy-Discussion mailing list