[SciPy-User] np.genfromtxt bug : breaks when # is present.

Pierre GM pgmdevlist at gmail.com
Wed Feb 2 18:10:13 EST 2011


On Feb 2, 2011, at 11:56 PM, Dharhas Pothina wrote:

> Hi,
>  
> I realized that after sending my email. 
>  
> I've never seen environmental monitoring data from equipment or from various entities have midline comments. i.e any comments always start  at the beginning of the line with the comment character in the first position. 

True, but...
Imagine you're working with some processed data (eg, a CSV you have generated), where comments appear at the end of a row to describe some potential problems for that record. That's a not too far-stretched case where discarding comments inline are a good thing to do.

> Is there any value in having an optional behavior in genfromtxt that only ignores lines starting with the comment character or is that too specific of a use case.

I'm afraid that's too specific. genfromtxt is already bloated as it is in my opinion that adding yet another parameter to control this behavior would be a bit too much. 

I'm really not keen on implementing it and would advise you to follow Corran's suggestion: please specify a comment character different from # in input.

Now, of course, if there's really a popular need for this feature (say, more than 5 people...)...

P.


More information about the SciPy-User mailing list