[NumPy-Tickets] [NumPy] #1557: Bug with dtype.type for structured arrays
NumPy Trac
numpy-tickets@scipy....
Tue Jul 27 09:14:42 CDT 2010
#1557: Bug with dtype.type for structured arrays
------------------------+---------------------------------------------------
Reporter: robitaille | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 2.0.0
Component: Other | Version:
Keywords: |
------------------------+---------------------------------------------------
If I create a structured array with vector columns:
{{{
>>> array = np.array(zip([[1,2],[1,2],[1,3]]),dtype=[('a',float,2)])
}}}
then examine the type of the column, I get:
{{{
>>> array.dtype[0]
dtype(('float64',(2,)))
}}}
Then, if I try and view the numerical type, I see:
{{{
>>> array.dtype[0].type
<type 'numpy.void'>
}}}
I have to basically do
{{{
>>> array.dtype[0].subdtype[0]
dtype('float64')
}}}
to get what I need. I seem to remember that this used not to be the case,
and
that even for vector columns, one could access array.dtype[0].type to get
the
numerical type.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1557>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list