[Numpy-discussion] genfromtxt to structured array
Fri Sep 25 16:40:17 CDT 2009
On Fri, Sep 25, 2009 at 4:30 PM, Timmie <firstname.lastname@example.org> wrote:
> this may be a easier question.
> I want to load data into an structured array with getting the names from the
> column header (names=True).
> The data looks like:
> but loading only works only if changed to:
> How do I read in the original data?
There's an assumption that the number of names is the same as the
number of columns. You can just specify the names and skip reading
the names from the file:
numpy.genfromtext(filename, delimiter=';', skiprows=1, names=['year',
'month', 'day', 'hour', 'value'])
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Norman, Oklahoma, United States
More information about the NumPy-Discussion