Mon Oct 15 11:42:53 CDT 2007
Yves Revaz wrote:
> Nadav Horesh wrote:
>> array(1, dtype=float32).itemsize
> ok, it will work fine for my purpose.
> In numpy, is there any reason to supress the attribute .bytes from the
> type object itself ?
> Is it simply because the native python types (int, float, complex, etc.)
> do not have this attribute ?
The problem is that the instances of the scalar types do have the itemsize
attribute. The implementation of type objects is such that the type object will
also have that attribute, but it will be a stub:
In : float64.itemsize
Out: <attribute 'itemsize' of 'numpy.generic' objects>
A more straightforward way to get the itemsize is this:
In : dtype(float64).itemsize
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion