hi, i'm using the new genfromtxt stuff in numpy svn, looks great pierre any who contributed. is there a way to have the header commented and still be able to have it recognized as the header? e.g. #gender age weight M 21 72.100000 F 35 58.330000 M 33 21.99 if i use np.loadtxt or genfromtxt, it tries to use the 2nd row (first non-commented as the header). and i get an array like: array([('M', 21, 72.099999999999994), ('F', 35, 58.329999999999998), ('M', 33, 21.989999999999998)], dtype=[('f0', '|S1'), ('f1', '<i4'), ('f2', '<f8')]) when i want: array([('M', 21, 72.099999999999994), ('F', 35, 58.329999999999998), ('M', 33, 21.989999999999998)], dtype=[('gender', '|S1'), ('age', '<i4'), ('weight', '<f8')]) i can get that by uncommenting the header, but it's useful to have that for other code. is there anyway to do that? thanks, -brent
Brent, Currently, no, you won't be able to retrieve the header if it's commented. I'll see what I can do. P.
Brent, Mind trying r6330 and let me know if it works for you ? Make sure that you use names=True to detect a header. P.
participants (2)
-
Brent Pedersen
-
Pierre GM