[Numpy-discussion] Structured array with no fields - possible?

Matthew Brett matthew.brett at gmail.com
Tue May 5 00:56:22 EDT 2009


Hi,

>> I'm trying to fix a bug in the scipy matlab loading routines, and this
>> requires me to somehow represent an empty structured array.
>>
>
> Do you need the struct to be empty (size is 0) or to have no fields ?
> What would you expect np.zeros((), dtype=np.dtype([])) to return, for
> example ?

Yes, I've got nothing - I have no idea what that might return.

I'm afraid what I need is some way of representing the fact that I
have read, from matlab, a structure with no fields (and therefore no
data) that can be - say - shape (10,2) - or any other.

Some time ago we thought of switching to structured arrays to
represent matlab structs, but this begins to make me think again.

Thanks for the replies,

Matthew



More information about the NumPy-Discussion mailing list