[Numpy-discussion] multiply array

2008-04-03 Thread wilson
hello i have two arrays #of shape (1,6) eval=array([[3.,3.2,1.,1.1,5.,0.5]]) #of shape (6,8) egimgs=array([ [3.,2.,1.,4.,5.,1.5,2.5,1.1], [1.1,3.,.5,.2,.1,4.3,3.2,1.2], [4.,3.,2.,6.,1.,4.,5.1,2.4], [3.2,1.3,2.2,4.4,1.1,2.1,3.3,2.4

Re: [Numpy-discussion] sorting ndarray

2008-04-03 Thread Eric Firing
harryos wrote: > i have a 1 dim numpy array > D=array( [[ 3. , 2. , 1. , 4. , 5. , 1.5, 2.2]] ) This is a 2-D array, not a 1-D array. > i need to get this sorted in descending order and then access the > elements . > D.sort() will make D as [[ 1. 1.5 2. 2.2 3. 4. 5. ]] > how will

[Numpy-discussion] sorting ndarray

2008-04-03 Thread harryos
i have a 1 dim numpy array D=array( [[ 3. , 2. , 1. , 4. , 5. , 1.5, 2.2]] ) i need to get this sorted in descending order and then access the elements . D.sort() will make D as [[ 1. 1.5 2. 2.2 3. 4. 5. ]] how will i reverse it? or is there a simpler way? harry

Re: [Numpy-discussion] Efficient reading of binary data

2008-04-03 Thread Nicolas Bigaouette
2008/4/3, Robert Kern <[EMAIL PROTECTED]>: > > On Thu, Apr 3, 2008 at 6:53 PM, Nicolas Bigaouette > <[EMAIL PROTECTED]> wrote: > > Thanx for the fast response Robert ;) > > > > I changed my code to use the slice: > > E = data[6::9]It is indeed faster and less eat less memory. Great. > > > > Thanx

Re: [Numpy-discussion] Efficient reading of binary data

2008-04-03 Thread Robert Kern
On Thu, Apr 3, 2008 at 6:53 PM, Nicolas Bigaouette <[EMAIL PROTECTED]> wrote: > Thanx for the fast response Robert ;) > > I changed my code to use the slice: > E = data[6::9]It is indeed faster and less eat less memory. Great. > > Thanx for the endiannes! I knew there was something like this ;) I

Re: [Numpy-discussion] Efficient reading of binary data

2008-04-03 Thread Nicolas Bigaouette
Thanx for the fast response Robert ;) I changed my code to use the slice: E = data[6::9] It is indeed faster and less eat less memory. Great. Thanx for the endiannes! I knew there was something like this ;) I suspect that, in '>f8', "f" means float and "8" means 8 bytes? >From some benchmarks, I

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Andrew Straw
Matthieu Brucher wrote: > > > 2008/4/3, Chris Barker <[EMAIL PROTECTED] > >: > > Robert Kern wrote: > > Just since that has been discussed a LOT, for years, I want to be > clear: > > > > Different versions of Microsoft's compiler use different > librari

[Numpy-discussion] loading data with gaps

2008-04-03 Thread Tim Michelsen
Hello! How can I load a data file (e.g. CSV, DAT) in ASCII which has some gaps? The file has been saved with from a spreadsheet program which leaves cells with not data empty: 1,23. 2,13. 3, 4,34. Would this code be correct: ### test_loadtxt.py ### import numpy import maskedarray # load data

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Matthieu Brucher
2008/4/3, Chris Barker <[EMAIL PROTECTED]>: > > Robert Kern wrote: > > Just since that has been discussed a LOT, for years, I want to be clear: > > > > Different versions of Microsoft's compiler use different libraries for > > the standard C library. Some simple Python extension modules compiled >

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Robert Kern
On Thu, Apr 3, 2008 at 4:52 PM, Chris Barker <[EMAIL PROTECTED]> wrote: > Robert Kern wrote: > > Just since that has been discussed a LOT, for years, I want to be clear: > > > Different versions of Microsoft's compiler use different libraries for > > the standard C library. Some simple Python ex

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Chris Barker
Robert Kern wrote: Just since that has been discussed a LOT, for years, I want to be clear: > Different versions of Microsoft's compiler use different libraries for > the standard C library. Some simple Python extension modules compiled > with a different compiler than the Python interpreter will

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Robert Kern
On Wed, Apr 2, 2008 at 9:21 PM, yunzhi cheng <[EMAIL PROTECTED]> wrote: > Hi Matthieu, > > I have to call a commercial software APIs from Python. If I import Numpy and > that software package in one script, they are not compatible. Sometimes > error occurs. But either one of them works well in Pyth

Re: [Numpy-discussion] Efficient reading of binary data

2008-04-03 Thread Robert Kern
On Thu, Apr 3, 2008 at 3:30 PM, Nicolas Bigaouette <[EMAIL PROTECTED]> wrote: > Hi, > > I have a C program which outputs large (~GB) files. It is a simple binary > dump of an array of structure containing 9 doubles. You can see this as a > double 1D array of size 9*Stot (Stot being the allocated si

[Numpy-discussion] Efficient reading of binary data

2008-04-03 Thread Nicolas Bigaouette
Hi, I have a C program which outputs large (~GB) files. It is a simple binary dump of an array of structure containing 9 doubles. You can see this as a double 1D array of size 9*Stot (Stot being the allocated size of the array of structure). The 1D array represents a 3D array (Sx * Sy * Sz = Stot)

Re: [Numpy-discussion] [SciPy-user] conforming to Python GIL...

2008-04-03 Thread Anne Archibald
On 03/04/2008, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > fred wrote: > > Hi, > > > > I use a lot of ConVeX OPTimsation and fortran (via f2py) routines in my > > Traits app. > > > > As I want to compute the data and want to display them, I use threads. > > > > The issue I get is that d

Re: [Numpy-discussion] [SciPy-user] conforming to Python GIL...

2008-04-03 Thread Gael Varoquaux
On Thu, Apr 03, 2008 at 02:56:29PM -0500, Robert Kern wrote: > ipython1 is great, but it is somewhat overkill for a problem like > this. The processing module is something worth looking at. > http://pypi.python.org/pypi/processing Wow, I didn't know this one. It seems very nice. Thanks for shar

Re: [Numpy-discussion] [SciPy-user] conforming to Python GIL...

2008-04-03 Thread Robert Kern
On Thu, Apr 3, 2008 at 2:48 PM, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > On Thu, Apr 03, 2008 at 02:44:43PM -0500, Travis E. Oliphant wrote: > > This requires a bit of effort to solve. We need to in multiple places... > > OK, then I suggest Fred looks into ipython1's parallel execution > fe

Re: [Numpy-discussion] [SciPy-user] conforming to Python GIL...

2008-04-03 Thread Gael Varoquaux
On Thu, Apr 03, 2008 at 02:44:43PM -0500, Travis E. Oliphant wrote: > This requires a bit of effort to solve. We need to in multiple places... OK, then I suggest Fred looks into ipython1's parallel execution features. The problem is that I suspect it is not mature-enough for him. Go Fernando, g

Re: [Numpy-discussion] missing function in numpy.ma?

2008-04-03 Thread Eric Firing
Charles Doutriaux wrote: > Travis, Pierre, > > Goood news what's in trunk right now seems to work great with our stuff, > I only had to replace numpy.core.ma.take with numpy.ma.take > (numpy.oldnumeric.ma.take didn't seem to work) I don't know if it fixes the problem you ran into, but there is

Re: [Numpy-discussion] [SciPy-user] conforming to Python GIL...

2008-04-03 Thread Travis E. Oliphant
fred wrote: > Hi, > > I use a lot of ConVeX OPTimsation and fortran (via f2py) routines in my > Traits app. > > As I want to compute the data and want to display them, I use threads. > > The issue I get is that data displayed (using Chaco2) are not updated > (app is frozen) while computing the in

Re: [Numpy-discussion] missing function in numpy.ma?

2008-04-03 Thread Travis E. Oliphant
Charles Doutriaux wrote: > Travis, Pierre, > > Goood news what's in trunk right now seems to work great with our stuff, > I only had to replace numpy.core.ma.take with numpy.ma.take > (numpy.oldnumeric.ma.take didn't seem to work) > > So as soon as 1.0.5 is out, I'll start working toward using nu

[Numpy-discussion] problem with float64's str()

2008-04-03 Thread Will Lee
Hi, I seem to have problem with floating point printing with the latest numpy, python 2.5.2, gcc 4.1.4, and 64-bit linux: In [24]: print str(0.0012) 0.0012 In [25]: a = numpy.array([0.0012]) In [26]: print str(a[0]) 0.0011999 In [27]: print numpy.__version__ 1.0.5.dev4950 It seems

Re: [Numpy-discussion] missing function in numpy.ma?

2008-04-03 Thread Charles Doutriaux
Travis, Pierre, Goood news what's in trunk right now seems to work great with our stuff, I only had to replace numpy.core.ma.take with numpy.ma.take (numpy.oldnumeric.ma.take didn't seem to work) So as soon as 1.0.5 is out, I'll start working toward using numpy.ma only. Also, I have one little

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Matthieu Brucher
> > > The supporters of the commercial software told me that their software is > > complied in VC++8. > > > So they have apparently compiled a python extension with VC++8 that > works? Are you sure that it works with the "standard" Windows Python > Build (Which version of Python, by the way?). From

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Christopher Barker
yunzhi cheng wrote: > I have to call a commercial software APIs from Python. If I import Numpy > and that software package in one script, they are not compatible. > Sometimes error occurs. But either one of them works well in Python. > Just they cannot exist together. > The supporters of the c

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Matthieu Brucher
Sorry, I mixed up the version numbers :| This means that you are on your own with compiling Python with VC++8 (2005). Matthieu 2008/4/3, Christian Heimes <[EMAIL PROTECTED]>: > > Matthieu Brucher schrieb: > > > Hi, > > > > As I've said, you must start by compiling Python with VC++ 8, that means >

Re: [Numpy-discussion] Compile Numpy in VC++8

2008-04-03 Thread Christian Heimes
Matthieu Brucher schrieb: > Hi, > > As I've said, you must start by compiling Python with VC++ 8, that means > using the 2.6 alpha. Negative Houston Python 2.6 and 3.0 are using VS 2008 aka VC 9.0 Christian ___ Numpy-discussion mailing list Numpy-dis