Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-13 Thread V. Armando Solé
On 11/06/2016 02:28, Allan Haldane wrote: So as an extra twist in this discussion, this means numpy actually *does* return a float value for an integer power in a few cases: >>> type( np.uint64(2) ** np.int8(3) ) numpy.float64 Shouldn't that example end up the discussion? I find th

Re: [Numpy-discussion] [JOB ANNOUNCEMENT] Software Developer permanent position available at ESRF, France

2014-02-20 Thread V. Armando Solé
Sorry, The link I sent you is in French. This is the English version. EUROPEAN SYNCHROTRON RADIATION FACILITY INSTALLATION EUROPEENNE DE RAYONNEMENT SYNCHROTRON   The ESRF is a multinational res

Re: [Numpy-discussion] Import error while freezing with cxfreeze

2013-04-10 Thread V. Armando Solé
Hello, On 10/04/2013 11:13, Anand Gadiyar wrote: On Friday, April 5, 2013, Anand Gadiyar wrote: Hi all, I have a small program that uses numpy and scipy. I ran into a couple of errors while trying to use cxfreeze to create a windows executable. I'm run

Re: [Numpy-discussion] Windows, blas, atlas and dlls

2013-02-18 Thread V. Armando Solé
Hi Sergio, I faced a similar problem one year ago. I solved it writing a C function receiving a pointer to the relevant linear algebra routine I needed. Numpy does not offers the direct access to the underlying library functions, but scipy does it: from scipy.linalg.blas import fblas dgemm = f

Re: [Numpy-discussion] (2012) Accessing LAPACK and BLAS from the numpy C API

2012-03-07 Thread V. Armando Solé
On 06/03/2012 20:57, Sturla Molden wrote: On 05.03.2012 14:26, "V. Armando Solé" wrote: In 2009 there was a thread in this mailing list concerning the access to BLAS from C extension modules. If I have properly understood the thread: http://mail.scipy.org/pipermail/numpy-discu

[Numpy-discussion] (2012) Accessing LAPACK and BLAS from the numpy C API

2012-03-05 Thread V. Armando Solé
Hello, In 2009 there was a thread in this mailing list concerning the access to BLAS from C extension modules. If I have properly understood the thread: http://mail.scipy.org/pipermail/numpy-discussion/2009-November/046567.html the answer by then was that those functions were not exposed (only

Re: [Numpy-discussion] Where is arrayobject.h?

2012-02-21 Thread V. Armando Solé
On 21/02/2012 19:26, Neal Becker wrote: > What is the correct way to find the installed location of arrayobject.h? > > On fedora, I had been using: > (via scons): > > import distutils.sysconfig > PYTHONINC = distutils.sysconfig.get_python_inc() > PYTHONLIB = distutils.sysconfig.get_python_lib(1) >

Re: [Numpy-discussion] abs for max negative integers - desired behavior?

2011-10-12 Thread V. Armando Solé
On 12/10/2011 10:46, David Cournapeau wrote: > On Wed, Oct 12, 2011 at 9:18 AM, "V. Armando Solé" wrote: >> From a pure user perspective, I would not expect the abs function to >> return a negative number. Returning +127 plus a warning the first time >> that happen

Re: [Numpy-discussion] abs for max negative integers - desired behavior?

2011-10-12 Thread V. Armando Solé
From a pure user perspective, I would not expect the abs function to return a negative number. Returning +127 plus a warning the first time that happens seems to me a good compromise. Armando On 12/10/2011 09:46, David Cournapeau wrote: > On Tue, Oct 11, 2011 at 8:16 PM, Charles R Harris > w

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-08 Thread V. Armando Solé
On 08/09/2011 16:16, Jim Vickroy wrote: > On 9/8/2011 6:09 AM, "V. Armando Solé" wrote: >> Have you tried to install Visual Studio 2008 Express edition (plus the >> windows SDK to be able to compile 64 bit code)? >> >> Armando > Armando, "Visual

Re: [Numpy-discussion] f2py : NotImplementedError: Only MS compiler supported with gfortran on win64

2011-09-08 Thread V. Armando Solé
Have you tried to install Visual Studio 2008 Express edition (plus the windows SDK to be able to compile 64 bit code)? Armando On 08/09/2011 13:56, Jim Vickroy wrote: > Hello All, I'm attempting to create a python wrapper, for a Fortran > subroutine, using f2py. > > My system details are: > >

Re: [Numpy-discussion] Ternary plots anywhere?

2010-07-06 Thread V. Armando Solé
Hi Ariel, Ariel Rokem wrote: > Hi Armando, > > Here's something in that direction: > > http://nature.berkeley.edu/~chlewis/Sourcecode.html > > > Hope that helps - Ariel > It really helps. It looks more complete than the only thing I had foun

[Numpy-discussion] Ternary plots anywhere?

2010-07-02 Thread V. Armando Solé
Dear all, Perhaps this is a bit off topic for the mailing list, but this is probably the only mailing list that is common to users of all python plotting packages. I am trying to find a python implementation of ternary/triangular plots: http://en.wikipedia.org/wiki/Ternary_plot but I have bee

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

2010-07-01 Thread V. Armando Solé
Ruben Salvador wrote: > Great! Thanks for all your answers! > > I actually have the files created as .npy (appending a new array eact > time). I know it's weird, and it's not its intended use. But, for > whatsoever reasons, I came to use that. No turn back now. > > Fortunately, I am able to read

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-10 Thread V. Armando Solé
Hi Bruce, In the context of the actual problem, I have a long series of non-equidistant and irregularly spaced float numbers and I have to take values between given limits with the constraint of keeping a minimal separation. Option 2 just misses the first value of the input array if it is with

Re: [Numpy-discussion] MemoryError with dot(A, A.T) where A is 800MB on 32-bit Vista

2010-06-09 Thread V. Armando Solé
greg whittier wrote: > When I run > > import numpy as np > > a = np.ones((400, 50), dtype=np.float32) > c = np.dot(a, a.T) > > produces a "MemoryError" on the 32-bit Enthought Python Distribution > on 32-bit Vista. I understand this has to do with the 2GB limit with > 32-bit python and the fac

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread V. Armando Solé
Hi Josef, I do not need regular spacing of the original data. I only need them to be sorted and that I get it with a previous numpy call. Then the algorithm using the cumsum does the trick without a explicit loop. Armando ___ NumPy-Discussion mailin

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread V. Armando Solé
Francesc Alted wrote: > Yeah, damn you! ;-) > I think you still have room for improvement ;-) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread V. Armando Solé
Wednesday 09 June 2010 10:00:50 V. Armando Solé escrigué: > >> Well, this seems to be quite close to what I need >> >> y = numpy.cumsum((x[1:]-x[:-1])/delta).astype(numpy.int) >> i1 = numpy.nonzero(y[1:] > y[:-1]) >> y = numpy.take(x, i1) >>

Re: [Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread V. Armando Solé
Well, this seems to be quite close to what I need y = numpy.cumsum((x[1:]-x[:-1])/delta).astype(numpy.int) i1 = numpy.nonzero(y[1:] > y[:-1]) y = numpy.take(x, i1) Sorry for the time taken! Best regards, Armando V. Armando Solé wrote: > Hello, > > I am trying to solve a simple

[Numpy-discussion] Simple problem. Is it possible without a loop?

2010-06-09 Thread V. Armando Solé
Hello, I am trying to solve a simple problem that becomes complex if I try to avoid looping. Let's say I have a 1D array, x, where x[i] <= x[i+1] Given a certain value delta, I would like to get a subset of x, named y, where (y[i+1] - y[i]) >= delta In a non-optimized and trivial way, the op

Re: [Numpy-discussion] min bug

2009-11-16 Thread V. Armando Solé
Sebastian Berg wrote: > Known issue, I think someone posted about it a while ago too. The numpy > min is array aware, and it expects an array. The second argument is the > axis, which in the case of a single number doesn't matter. > > On Tue, 2009-11-17 at 07:07 +, Chris wrote: > >> I'm pret

Re: [Numpy-discussion] Failed installation on Windows XP

2009-11-12 Thread V. Armando Solé
Hola, I am not an expert, but I had a similar issue with a program of main that I could trace to not having installed VS9 runtime libraries in the target computer: http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en Perhaps you can give

Re: [Numpy-discussion] Resize Method for Numpy Array

2009-09-24 Thread V. Armando Solé
V. Armando Solé wrote: Sorry, there was a bug in the sent code. It should be: > import numpy > a=numpy.arange(100.) > a.shape = 10, 10 > b = a * 1 # just to get a copy > b.shape = 5, 2, 5, 2 > b = (b.sum(axis=3)).sum(axis=1) > > In that way, on b I

Re: [Numpy-discussion] Resize Method for Numpy Array

2009-09-24 Thread V. Armando Solé
Alice Invernizzi wrote: > > Dear all, > > I have an Hamletic doubt concerning the numpy array data type. > A general learned rule concerning the array usage in other high-level > programming languages is that array data-type are homogeneous datasets > of fixed dimension. > > Therefore, is not cl

Re: [Numpy-discussion] Dot product performance on python 2.6 (windows)

2009-09-11 Thread V. Armando Solé
David Cournapeau wrote: > V. Armando Solé wrote: > >> Hello, >> >> It seems to point towards a packaging problem. >> >> In python 2.5, I can do: >> >> import numpy.core._dotblas as dotblas >> dotblas.__file__ >> >> and I get:

Re: [Numpy-discussion] Dot product performance on python 2.6 (windows)

2009-09-11 Thread V. Armando Solé
Sturla Molden wrote: > V. Armando Solé skrev: > >> In python 2.6: >> >> >>>import numpy.core._dotblas as dotblas >> ... >> ImportError: No module named _dotblas >> >> > > >>> import numpy.core._dotblas as dotblas

Re: [Numpy-discussion] Dot product performance on python 2.6 (windows)

2009-09-11 Thread V. Armando Solé
Hello, It seems to point towards a packaging problem. In python 2.5, I can do: import numpy.core._dotblas as dotblas dotblas.__file__ and I get: C:\\Python25\\lib\\site-packages\\numpy\\core\\_dotblas.pyd In python 2.6: >>>import numpy.core._dotblas as dotblas ... ImportError: No module nam

Re: [Numpy-discussion] Dot product performance on python 2.6 (windows)

2009-09-11 Thread V. Armando Solé
David Cournapeau wrote: > V. Armando Solé wrote: > >> Hello, >> >> I have found performance problems under windows when using python 2.6 >> In my case, they seem to be related to the dot product. >> >> The following simple script: >> >>

[Numpy-discussion] Dot product performance on python 2.6 (windows)

2009-09-11 Thread V. Armando Solé
Hello, I have found performance problems under windows when using python 2.6 In my case, they seem to be related to the dot product. The following simple script: import numpy import time a=numpy.arange(100.) a.shape=1000,1000 t0=time.time() b=numpy.dot(a.T,a) print "Elapsed time = ",time.tim

Re: [Numpy-discussion] How to concatenate two arrayswithout duplicating memory?

2009-09-02 Thread V. Armando Solé
Citi, Luca wrote: > As Gaël pointed out you cannot create A, B and then C > as the concatenation of A and B without duplicating > the vectors. > > But you can still re-link A to the left elements > and B to the right ones afterwards by using views into C. > Thanks for the hint. In my case th

Re: [Numpy-discussion] How to concatenate two arrays without duplicating memory?

2009-09-02 Thread V. Armando Solé
Gael Varoquaux wrote: > You cannot in the numpy memory model. The numpy memory model defines an > array as something that has regular strides to jump from an element to > the next one. > I expected problems in the suggested case (concatenating columns) but I did not expect the problem would be

[Numpy-discussion] How to concatenate two arrays without duplicating memory?

2009-09-02 Thread V. Armando Solé
Hello, Let's say we have two arrays A and B of shapes (1, 2000) and (1, 4000). If I do C=numpy.concatenate((A, B), axis=1), I get a new array of dimension (1, 6000) with duplication of memory. I am looking for a way to have a non contiguous array C in which the "left" (1, 2000

Re: [Numpy-discussion] ANN: HDF5 for Python (h5py) 1.2

2009-06-23 Thread V. Armando Solé
Dear Andrew, I have succeeded on generating a win32 binary installer for python 2.6. Running depends on the installed libraries it shows there are no dependencies on other libraries than those of VS2008. I have tried to send it to you directly but I am not sure if your mail address accepts att

Re: [Numpy-discussion] Solving a memory leak in a numpy extension; PyArray_ContiguousFromObject

2009-04-20 Thread V. Armando Solé
Dan S wrote: > But as you can see, my C code doesn't perform any malloc() or > suchlike, so I'm stumped. > > I'd be grateful for any further thoughts Could it be your memory leak is in: return PyFloat_FromDouble(3.1415927); // temporary You are creating a "python float object" from something. Wh

Re: [Numpy-discussion] How to force a particular windows numpy installation?

2009-03-19 Thread V. Armando Solé
Francesc Alted wrote: > Arch option for windows binary > ~~ > > Automatic arch detection can now be bypassed from the command line for > the superpack installed: > > numpy-1.3.0-superpack-win32.exe /arch=nosse > > will install a numpy which works on any x86, even