[Numpy-discussion] get a dtypes' range?

Robert Kern robert.kern@gmail....
Fri Jun 17 15:10:37 CDT 2011


On Fri, Jun 17, 2011 at 14:26, Christopher Barker <Chris.Barker@noaa.gov> wrote:

> I guess I'm confused about the difference between:
>
> np.dtype(uint16)
>
> and
>
> np.uint16
>
> since I always pass in the later when a dtype is called for.

Whenever a dtype= argument is present, we also accept anything that
can be converted to a dtype via np.dtype(x). The following are all
equivalent:

  dtype=float
  dtype='float'
  dtype='float64'
  dtype=np.float64
  dtype='f8'
  dtype='d'
  dtype=np.dtype(float)

-- 
Robert Kern

"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 mailing list