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

Matthew Brett matthew.brett@gmail....
Mon May 4 23:56:22 CDT 2009


>> 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,


More information about the Numpy-discussion mailing list