[Numpy-discussion] Is a string a scalar type?

Charles R Harris charlesr.harris at gmail.com
Sat Mar 24 21:27:31 EDT 2007


On 3/24/07, Robert Kern <robert.kern at gmail.com> wrote:
>
> Charles R Harris wrote:
> > In [10]: isscalar('hello world')
> > Out[10]: True
>
> As far as numpy is concerned, they are.
>
> >>> from numpy import *
> >>> array('hello world')
> array('hello world',
>       dtype='|S11')


Dunno, by that reasoning objects could also be considered scalars as they
can be elements of object arrays.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20070324/2bf6adff/attachment.html>


More information about the NumPy-Discussion mailing list