[Numpy-discussion] Forbidden charcter in the "names" argument of genfromtxt?

Adam Hughes hugadams at gwmail.gwu.edu
Sat Feb 18 21:12:20 EST 2012


Hey everyone,

I have timeseries data in which the column label is simply a filename from
which the original data was taken.  Here's some sample data:

name1.txt  name2.txt  name3.txt
32              34            953
32              03            402

I've noticed that the standard genfromtxt() method works great; however,
the names aren't written correctly.  That is, if I use the command:

print data['name1.txt']

Nothing happens.

However, when I remove the file extension, Eg:

name1  name2  name3
32              34            953
32              03            402

Then print data['name1'] return (32, 32) as expected.  It seems that the
period in the name isn't compatible with the genfromtxt() names attribute.
Is there a workaround, or do I need to restructure my program to get the
extension removed?  I'd rather not do this if possible for reasons that
aren't important for the discussion at hand.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120218/cfc1ceaa/attachment.html>


More information about the NumPy-Discussion mailing list