Re: [Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Nadav Horesh
How about: numpy.fromfile(filename, dtype='>i2') Nadav -Original Message- From: [EMAIL PROTECTED] on behalf of Pierre GM Sent: Fri 06-Apr-07 18:41 To: Discussion of Numerical Python Cc: Subject:Re: [Numpy-discussion] problem reading binary data from file On Friday

Re: [Numpy-discussion] F2PY and underscore problem

2007-04-06 Thread Tyler J Hayes
Zdeněk Hurák fel.cvut.cz> writes: > Sorry for not giving this important detail. I use gcc-4.1.1 compiler suite, > which means that gfortran is used as a Fortran compiler. The same compiler > was used to build Lapack. I'm not sure if this will help, but have you tried to specify the gfortran compi

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David Shepherd
Okay, I manually changed defined(linux) to defined(__GLIBC__). I still get the same error with "_capi.c". It keeps trying to #include . Any other things I can change to try to prevent the problem? Thanks, David -Dave Error output: creating build/temp.linux-ppc-2.5/numpy/lib creating build/

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 7, Issue 13

2007-04-06 Thread Travis Oliphant
Matthew Koichi Grimes wrote: >Travis wrote: > > >>Short answer: No, they are not bugs. >> >>The rule is: >> >>In any mixed-type operation between two objects of the same >>fundamental "kind" (i.e. integer, float, complex) arrays always have >>precedence over "scalars" (where a 0-d array is c

Re: [Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Christopher Barker
> In fact numpy.fromfile was the first function I tried to use but I > couldn't manage to get it working with the byteorder I needed > (big-endian). a = fromfile(...) a.byteswap(True) -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959

Re: [Numpy-discussion] Numpy-discussion Digest, Vol 7, Issue 13

2007-04-06 Thread Matthew Koichi Grimes
Travis wrote: > > Short answer: No, they are not bugs. > > The rule is: > > In any mixed-type operation between two objects of the same > fundamental "kind" (i.e. integer, float, complex) arrays always have > precedence over "scalars" (where a 0-d array is considered a scalar > in this context

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David M. Cooke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Shepherd wrote: > The second part of the patch is failing: > > # patch -p0 < ../uclibc-fenv.patch > patching file numpy/core/include/numpy/ufuncobject.h > patching file numpy/numarray/_capi.c > Hunk #1 FAILED at 224. > Hunk #2 FAILED at 2937. >

Re: [Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Giorgio F. Gilestro
Thanks to everyone, really. I already know this ml is going to be as useful as numpy itself! In fact numpy.fromfile was the first function I tried to use but I couldn't manage to get it working with the byteorder I needed (big-endian). The ['f0'] trick works very nicely though, so I think I'll us

Re: [Numpy-discussion] I can't know where I update the code...

2007-04-06 Thread Robert Kern
Chris wrote: >> Sorry, this is not an answer, but it might help someone else to answer your >> question: importing weave (using numpy-1.0.2) is one way to get this error >> message. > > Is this something we should post on the scipy-dev mailing list instead? > (Maybe > there are other parts of

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David Shepherd
The second part of the patch is failing: # patch -p0 < ../uclibc-fenv.patch patching file numpy/core/include/numpy/ufuncobject.h patching file numpy/numarray/_capi.c Hunk #1 FAILED at 224. Hunk #2 FAILED at 2937. 2 out of 2 hunks FAILED -- saving rejects to file numpy/numarray/_capi.c.rej # I at

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David M. Cooke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Shepherd wrote: > You know, looking at the core it looks like it has something to do with > the "define(linux)" statement. I am running linux, but its a buildroot > (uclibc) rootfs. Let me know if you need anymore information. Thanks. > > D

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David Shepherd
You know, looking at the core it looks like it has something to do with the "define(linux)" statement. I am running linux, but its a buildroot (uclibc) rootfs. Let me know if you need anymore information. Thanks. Dave David Shepherd wrote: > Well, I get further into the compile process, but

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David Shepherd
Well, I get further into the compile process, but now it fails on another gcc compile operations. This is essentially the same error message I was getting before. It tries to #include , but does not find it (it shouldn't be including it anyway, as you said). This time it fails when trying to

Re: [Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Christopher Barker
Pierre GM wrote: > With numpy.core.records, you create a record array. Just get the field ('f0' > by default) to get a ndarray. there is. Don't use numpy.core.records. Use numpy.fromfile: import numpy a = numpy.fromfile(filename, dtype=numpy.int16) (filename can be a filename, or an open file

Re: [Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Travis Oliphant
Giorgio F. Gilestro wrote: >Hello everyone. > >Here I go with my first problem for this ml! > >I am reading a long sequence of binary data from a file using a call >similar to the following > >numpy.core.records.fromfile (filename, formats='i2', byteorder='big') > >My problem is that this function

Re: [Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Pierre GM
On Friday 06 April 2007 12:14:20 Giorgio F. Gilestro wrote: > Is there any way I could get a 1D array (no tuples please!) directly > from the file? > (BTW numpy.core.records.fromstring gives the same output) numpy.core.records.fromfile (filename, formats='i2', byteorder='big')['f0'] With numpy.c

[Numpy-discussion] problem reading binary data from file

2007-04-06 Thread Giorgio F. Gilestro
Hello everyone. Here I go with my first problem for this ml! I am reading a long sequence of binary data from a file using a call similar to the following numpy.core.records.fromfile (filename, formats='i2', byteorder='big') My problem is that this function returns an array of tuples rather tha

Re: [Numpy-discussion] how to run the tests.

2007-04-06 Thread Christopher Barker
Robert Kern wrote: > They are, but an older one. There have been significant improvements to the > Core > Duo 2 code in ATLAS releases, but no updates to Accelerate. Let's hope they'll be forthcoming. Thanks for the update. This may be important to me soon. -Chris -- Christopher Barker, Ph.D

Re: [Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David M. Cooke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Shepherd wrote: > Hey all, > > We started to try and compile the numpy module on an embedded PowerPC > Xilinx board with no luck. This is one of the errors I get when I try > to build the module on-board. It is due to the fact that the compi

[Numpy-discussion] Numpy with uclibc compiled python

2007-04-06 Thread David Shepherd
Hey all, We started to try and compile the numpy module on an embedded PowerPC Xilinx board with no luck. This is one of the errors I get when I try to build the module on-board. It is due to the fact that the compiler is located in a different location than the original compiler for python

Re: [Numpy-discussion] I can't know where I update the code...

2007-04-06 Thread Chris
> Sorry, this is not an answer, but it might help someone else to answer your > question: importing weave (using numpy-1.0.2) is one way to get this error > message. Is this something we should post on the scipy-dev mailing list instead? (Maybe there are other parts of scipy that need to be up

Re: [Numpy-discussion] I can't know where I update the code...

2007-04-06 Thread Chris
> Warning (from warnings module):  File "C:\Python25\lib\site- packages\numpy\testing\numpytest.py", line 634    DeprecationWarning) DeprecationWarning: ScipyTest is now called NumpyTest; please update your code Sorry, this is not an answer, but it might help someone else to answer your questio

[Numpy-discussion] I can't know where I update the code...

2007-04-06 Thread Hui Chang Moon
Warning (from warnings module): File "C:\Python25\lib\site-packages\numpy\testing\numpytest.py", line 634 DeprecationWarning) DeprecationWarning: ScipyTest is now called NumpyTest; please update your code I have written the simulation code with numpy 1.0.1 & scipy 0.52. I installed the numpy