Re: [Numpy-discussion] loadtxt bug?

2007-11-23 Thread Alan G Isaac
> On Fri, Nov 23, 2007 at 07:58:13AM -0500, Alan G Isaac wrote: >> Specifically, is it not the case that the last line of >> a text file is not guaranteed to have a terminator? Does >> this not raise the possibility that a digit will be >> clipped from the last line? On Fri, 23 Nov 2007, Gae

Re: [Numpy-discussion] loadtxt bug?

2007-11-23 Thread Gael Varoquaux
On Fri, Nov 23, 2007 at 07:58:13AM -0500, Alan G Isaac wrote: > > On Thu, Nov 22, 2007 at 11:14:07PM -0500, Alan G Isaac wrote: > >> In numpy.core.numeric.py you will find loadtxt, which uses > >> the following:: > >> line = line[:line.find(comments)].strip() > On Fri, 23 Nov 2007, Gael

Re: [Numpy-discussion] loadtxt bug?

2007-11-23 Thread Alan G Isaac
> On Thu, Nov 22, 2007 at 11:14:07PM -0500, Alan G Isaac wrote: >> In numpy.core.numeric.py you will find loadtxt, which uses >> the following:: >> line = line[:line.find(comments)].strip() On Fri, 23 Nov 2007, Gael Varoquaux apparently wrote: > Unless you are sure that line always ends

Re: [Numpy-discussion] loadtxt bug?

2007-11-22 Thread Gael Varoquaux
On Thu, Nov 22, 2007 at 11:14:07PM -0500, Alan G Isaac wrote: > In numpy.core.numeric.py you will find loadtxt, which uses > the following:: > line = line[:line.find(comments)].strip() > I believe there is a bug here (when a line has no comment). > To illustrate:: > >>> line = "12345

[Numpy-discussion] loadtxt bug?

2007-11-22 Thread Alan G Isaac
In numpy.core.numeric.py you will find loadtxt, which uses the following:: line = line[:line.find(comments)].strip() I believe there is a bug here (when a line has no comment). To illustrate:: >>> line = "12345" >>> comments = "#" >>> line[:line.find(comments)] '1234' So