Re: [Numpy-discussion] loadtxt() behavior on single-line files

2010-06-24 Thread Benjamin Root
On Thu, Jun 24, 2010 at 1:00 PM, Warren Weckesser < warren.weckes...@enthought.com> wrote: > Benjamin Root wrote: > > Hi, > > > > I was having the hardest time trying to figure out an intermittent bug > > in one of my programs. Essentially, in some situations, it was > > throwing an error saying

Re: [Numpy-discussion] loadtxt() behavior on single-line files

2010-06-24 Thread Christopher Barker
Warren Weckesser wrote: > Benjamin Root wrote: >> Note that this isn't restricted to structured arrays. For regular >> ndarrays, loadtxt() appears to mimic the behavior of np.squeeze(): > > Exactly. The last four lines of the function are: > > X = np.squeeze(X) > if unpack: > r

Re: [Numpy-discussion] loadtxt() behavior on single-line files

2010-06-24 Thread Warren Weckesser
Benjamin Root wrote: > Hi, > > I was having the hardest time trying to figure out an intermittent bug > in one of my programs. Essentially, in some situations, it was > throwing an error saying that the array object was not an array. It > took me a while, but then I figured out that my program

Re: [Numpy-discussion] numpy.load raising IOError but EOFError expected

2010-06-24 Thread Friedrich Romstedt
2010/6/23 Ruben Salvador : > Therefore, is this a bug? Shouldn't EOFError be raised instead of IOError? > Or am I missunderstanding something? If this is not a bug, how can I detect > the EOF to stop reading (I expect a way for this to work without tweaking > the code with saving first in the file

[Numpy-discussion] loadtxt() behavior on single-line files

2010-06-24 Thread Benjamin Root
Hi, I was having the hardest time trying to figure out an intermittent bug in one of my programs. Essentially, in some situations, it was throwing an error saying that the array object was not an array. It took me a while, but then I figured out that my program was assuming that the object retur