Re: [Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()

2006-12-13 Thread Tim Hirzel
;[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Tim Hirzel wrote: > > >Good thought Chris, > >Normal reading and writing does seem to work. .. > >But, my friend Daniel figured out a workaround when I asked to > confirm >

Re: [Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()

2006-12-12 Thread Tim Hirzel
sing 'f.file' would work on linux too in terms of having a single cross-platform solution. cheers, tim Christopher Barker wrote: > did you try reading and writing to/from that temp file with regular old > python functions? > > -Chris > > > Tim Hirzel wrote:

Re: [Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()

2006-12-12 Thread Tim Hirzel
> I'm running linux and the current svn version of numpy. Maybe the > problem is with the tempfile module on windows. Do fromfile and tofile > work for files opened normally? > > Chuck fromfile and tofile work fine on regular files. From skimming the code a bit, it's hard to imagine numpy cod

Re: [Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()

2006-12-12 Thread Tim Hirzel
Hi Chuck, Thanks for checking that. I am running numpy 1.0.1 in python 2.4 on win32 (xp). Are you on linux? I double checked the behavior in 1.0 and 1.0.1, just to be extra sure, and it thows the IOError in both cases. tim Charles R Harris wrote: > > > On 12/11/06, *Tim Hirzel

[Numpy-discussion] fromfile and tofile access with a tempfile.TemporaryFile()

2006-12-11 Thread Tim Hirzel
Hi, Does anyone know how to get fromfile and tofile to work from a tempfile.TemporaryFile? Or if its not possible? I am getting this: >>> import tempfile >>> f = tempfile.TemporaryFile() >>> f ', mode 'w+b' at 0x01EE1728> >>> a = numpy.arange(10) >>> a.tofile(f) Traceback (most recent call

Re: [Numpy-discussion] strange behavior with a numpy array as member of a list

2006-11-30 Thread Tim Hirzel
Excellent. That explains it. thank you Robert, tim Robert Kern wrote: > Tim Hirzel wrote: > >> Thanks Robert. >> That makes more sense now. Although I am still a little puzzled by the >> equality behavior of an array. for example: >> >> >>> a

Re: [Numpy-discussion] strange behavior with a numpy array as member of a list

2006-11-30 Thread Tim Hirzel
None, 5], dtype=object) >>> b == 4 array([False, False], dtype=bool) What determines if an array tests for equality as the entire array or element-wise? thanks again, tim Robert Kern wrote: > Tim Hirzel wrote: > >> Does this seem odd to anyone else? I am not sure abo

[Numpy-discussion] strange behavior with a numpy array as member of a list

2006-11-30 Thread Tim Hirzel
Hi All, When a list contains a numpy array and I want to see if a value is a member of that list, I can get a value error from numpy: >>> import numpy >>> numpy.__version__ '1.0' >>> a = numpy.arange(10) >>> L = [a] >>> a in L True >>> 2 in L Traceback (most recent call last): File "", lin