[Numpy-discussion] record array question

Robert Kern robert.kern@gmail....
Wed Jul 15 13:26:08 CDT 2009


On Wed, Jul 15, 2009 at 13:05, Russell E. Owen<rowen@uw.edu> wrote:
> Is it straightforward to generate a record array (preferably a standard
> numpy.ndarray, not the numpy.rec variant) where some named fields
> contain pairs of numbers, for example:
>
> named field pos contains pairs of floats
> named field rot contains floats

dt = np.dtype([('pos', float, [2]), ('rot', 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