[Numpy-discussion] Fastest way of distinguish a numpy scalar of a python scalar?

Francesc Altet faltet at carabos.com
Tue Oct 3 12:55:31 EDT 2006


Hi,

I thought that numpy.isscalar was a good way of distinguising a numpy scalar 
from a python scalar, but it seems not:

>>> numpy.isscalar(numpy.string_('3'))
True
>>> numpy.isscalar('3')
True

Is there an easy (and fast, if possible) way to check whether an object is a 
numpy scalar or a python one?

Thanks,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"




More information about the NumPy-Discussion mailing list