[Numpy-discussion] genloadtxt: dtype=None and unpack=True
Thu Feb 12 10:36:04 CST 2009
On Wed, Feb 11, 2009 at 10:47 PM, Pierre GM <email@example.com> wrote:
> On Feb 11, 2009, at 11:38 PM, Ryan May wrote:
> > Pierre,
> > I noticed that using dtype=None with a heterogeneous set of data,
> > trying to use unpack=True to get the columns into separate arrays
> > (instead of a structured array) doesn't work. I've attached a patch
> > that, in the case of dtype=None, unpacks the fields in the final
> > array into a list of separate arrays. Does this seem like a good
> > idea to you?
> Nope, as it breaks consistency: depending on some input parameters,
> you either get an array or a list. I think it's better to leave it as
> it is, maybe adding an extra line in the doc precising that
> unpack=True doesn't do anything for structured arrays.
Ah, I hadn't thought of that. I was only thinking in terms of the behavior
of unpacking on return, not in the actual returned object. You're right,
it's a bad idea.
Graduate Research Assistant
School of Meteorology
University of Oklahoma
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion