[Numpy-discussion] loadmat output (was Re: Accessing elements of an object array)
matthew.brett at gmail.com
Wed Mar 16 18:05:00 EDT 2011
On Wed, Mar 16, 2011 at 1:56 PM, <lists_ravi at lavabit.com> wrote:
>> On Wed, Mar 16, 2011 at 15:18, <lists_ravi at lavabit.com> wrote:
>>> In : x
>>> array(array((7.399500875785845e-10, 7.721153414752673e-10, -0.984375),
>>> Â Â Â dtype=[('cl', '|O8'), ('tl', '|O8'), ('dagc', '|O8')]),
>>> In : x.shape, x.size
>>> Out: ((), 1)
>> It's not that it's an object array. It's that it is a ()-shape array.
>> You index it with an empty tuple:
> Why does loadmat return such arrays? Is there a way to make it produce
> arrays that are not object arrays?
Did you find the struct_as_record option to loadmat?
More information about the NumPy-Discussion