Re: [Numpy-discussion] Integers to negative integer powers, time for a decision.

2016-10-08 Thread V. Armando Sole
Well, testing under windows 64 bit, Python 3.5.2, positive powers of integers give integers and negative powers of integers give floats. So, do you want to raise an exception when taking a negative power of an element of an array of integers? Because not doing so would be inconsistent with

Re: [Numpy-discussion] Integers to negative integer powers, time for a decision.

2016-10-07 Thread V. Armando Sole
Hi all, Just to have the options clear. Is the operator '**' going to be handled in any different manner than pow? Thanks. Armando ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion

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

2016-06-04 Thread V. Armando Sole
Also in favor of 2. Always return a float for '**' On 04.06.2016 21:47, josef.p...@gmail.com wrote: On Sat, Jun 4, 2016 at 3:43 PM, Charles R Harris wrote: On Sat, Jun 4, 2016 at 11:22 AM, Charles R Harris wrote: Hi All, I've made a

Re: [Numpy-discussion] Best way to expose std::vector to be used with numpy

2014-10-15 Thread V. Armando Sole
On 15.10.2014 21:48, Chris Barker wrote: Sorry about SWIG -- maybe a chance to move on ;-) I'd go with Cython -- this is pretty straightforward, and it handles the buffer protocol for you under the hood. +1 All the standard containers are automatically wrapped and C++ exceptions can be

Re: [Numpy-discussion] [JOB ANNOUNCEMENT] Software Developer permanent position

2014-02-21 Thread V. Armando Sole
On 21.02.2014 10:55, David Goldsmith wrote: On Thu, Feb 20, 2014 at 10:37 PM, wrote: Date: Fri, 21 Feb 2014 07:43:17 +0100 From: V. Armando Sol? *Ref. 8173* *- Deadline for returning application forms: * *01/04/2014* I assume thats the European date format, i.e., the due date is April

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

2014-02-20 Thread V. Armando Sole
Dear colleagues, The ESRF is looking for a Software Developer: http://esrf.profilsearch.com/recrute/fo_annonce_voir.php?id=300 Our ideal candidate would be experienced on OpenGL, OpenCL and Python. Best regards, Armando ___ NumPy-Discussion mailing

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

2014-02-20 Thread V. Armando Sole
Sorry, the link was in French ... The English version: http://esrf.profilsearch.com/recrute/fo_form_cand.php?_lang=enid=300 Best regards, Armando On 20.02.2014 18:21, V. Armando Sole wrote: Dear colleagues, The ESRF is looking for a Software Developer: http://esrf.profilsearch.com

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

2013-02-22 Thread V. Armando Sole
On 22.02.2013 19:54, Sergio Callegari wrote: from scipy.linalg.blas import fblas dgemm = fblas.dgemm._cpointer sgemm = fblas.sgemm._cpointer OK, but this gives me a PyCObject. How do I make it a function pointer of the correct type in cython? In cython I do not know it. I coded it

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

2013-02-18 Thread V. Armando Sole
On 18.02.2013 21:23, Pauli Virtanen wrote: 18.02.2013 20:41, Dag Sverre Seljebotn kirjoitti: [clip] I think there should be a new project, pylapack or similar, for this, outside of NumPy and SciPy. NumPy and SciPy could try to import it, and if found, fetch a function pointer table. (If

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

2013-02-18 Thread V. Armando Sole
On 18.02.2013 22:47, Pauli Virtanen wrote: 18.02.2013 23:29, V. Armando Sole kirjoitti: [clip] I find Dag's approach more appealing. SciPy can be problematic (windows 64-bit) and if one could offer access to the linear algebra functions without needing SciPy I would certainly prefer

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

2012-03-10 Thread sole
Hi Sturla, Quoting Sturla Molden stu...@molden.no: Den 10.03.2012 22:56, skrev Sturla Molden: I am not sure why NumPy uses f2c'd routines instead of a dependency on BLAS and LAPACK like SciPy. Actually, np.dot does depend on the CBLAS interface to BLAS (_dotblas.c). But the lapack

Re: [Numpy-discussion] Long-standing issue with using numpy in embedded CPython

2011-12-09 Thread Vicente Sole
Quoting Robert Kern robert.k...@gmail.com: On Fri, Dec 9, 2011 at 11:00, Yang Zhang yanghates...@gmail.com wrote: Thanks for the clarification.  Alas.  So is there no simple workaround to making numpy work in environments such as Jepp? I don't think so, no. It is far from being an optimal

Re: [Numpy-discussion] what python module to modify NetCDF data?

2011-10-08 Thread Vicente Sole
Hi, I have never seen myself a NetCDF file but if your NetCDF file is using HDF5 as format (possible since NetCDF 4 if I am not mistaken), you should be able to use h5py or PyTables to access and or modify it. Best regards, Armando Quoting Chao YUE chaoyue...@gmail.com: Dear all, I

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

2010-06-09 Thread Vicente Sole
Correct. I thought just multiplying by -1 and inverting the logical condition would give me the same output. This makes exactly what I want: x= numpy.arange(10.) delta=3 y=[x[0]] for value in x: ... if (value-y[-1]) delta: ...y.append(value) ... y [0., 4., 8.] Armando

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

2010-06-09 Thread Vicente Sole
? Well a loop or list comparison seems like a good choice to me. It is much more obvious at the expense of two LOCs. Did you profile the two possibilities and are they actually performance-critical? cheers The second is between 8 and ten times faster on my machine. import numpy import

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

2010-06-09 Thread Vicente Sole
. Armando Quoting Vicente Sole s...@esrf.fr: ? Well a loop or list comparison seems like a good choice to me. It is much more obvious at the expense of two LOCs. Did you profile the two possibilities and are they actually performance-critical? cheers The second is between 8 and ten times

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

2010-06-09 Thread Vicente Sole
Quoting josef.p...@gmail.com: but the two options don't produce the same result in general, the cumsum version doesn't restart from zero, I think try x0 = np.random.randint(5,size=30).cumsum() with delta=3 I don't see a way around recursive looping The x0 data are already sorted. It was

Re: [Numpy-discussion] Matrix operation.

2010-04-02 Thread Vicente Sole
With A and X being arrays: B=numpy.zeros(A.shape, A.dtype) B[A0] = X Armando Quoting gerardob gberbeg...@gmail.com: Let A be a square matrix of 0's and 1's, and let X be a one dimesional vector. The length of X is equal to the number of 1's that A has. I would like to produce a new

Re: [Numpy-discussion] performance matrix multiplication vs. matlab

2010-01-18 Thread Vicente Sole
Quoting Bruce Southey bsout...@gmail.com: On 01/18/2010 12:47 PM, Vicente Sole wrote: Quoting Bruce Southey bsout...@gmail.com: If you obtain the code from any package then you are bound by the terms of that code. So while a user might not be 'inconvenienced' by the LGPL, they are required

Re: [Numpy-discussion] Numpy unexpected (for me) behaviour

2009-01-23 Thread V. Armando Sole
At 01:44 23/01/2009 -0600, Robert Kern wrote: It is an inevitable consequence of several features interacting together. Basically, Python expands a[b] += 1 into this: c = a[b] d = c.__iadd__(1) a[b] = d Basically, the array c doesn't know that it was created by indexing a, so it can't

[Numpy-discussion] Numpy unexpected (for me) behaviour

2009-01-22 Thread V. Armando Sole
Hello, In an effort to suppress for loops, I have arrived to the following situation. Through vectorial logical operations I generate a set of indices for which the contents of an array have to be incremented. My problem can be reduced to the following: #This works import numpy