Re: [Numpy-discussion] NumPy lesson at EuroScipy2016?

2016-06-11 Thread Emmanuelle Gouillart
Dear Bartocz, thank you very much for proposing a tutorial on advanced NumPy for Euroscipy 2016! I think it's an awesome idea! Before the call for proposals, I did a survey about the subjects that people were interested in for the advanced tutorials, and advanced NumPy scored very high (see the

[Numpy-discussion] Euroscipy 2012: early bird registration ending soon

2012-07-10 Thread Emmanuelle Gouillart
Hello, early bird registration for Euroscipy 2012 is soon coming to an end, with the deadline on July 22nd. Don't forget to register soon! Reduced fees are available for academics, students and speakers. Registration takes place online on http://www.euroscipy.org/conference/euroscipy2012.

[Numpy-discussion] Euroscipy 2012 deadline extension: May 7th

2012-04-30 Thread Emmanuelle Gouillart
The committee of the Euroscipy 2012 conference has extended the deadline for abstract submission to **Monday May 7th, midnight** (Brussels time). Up to then, new abstracts may be submitted on http://www.euroscipy.org/conference/euroscipy2012, and already-submitted abstracts can be modified. We

[Numpy-discussion] Euroscipy 2012 - abstract deadline soon (April 30) + sprints

2012-04-22 Thread Emmanuelle Gouillart
Hello, this is a reminder of the approaching deadline for abstract submission at the Euroscipy 2012 conference: the deadline is April 30, in one week. Euroscipy 2012 will be held in **Brussels**, **August 23-27**, at the Université Libre de Bruxelles (ULB, Solbosch Campus). The EuroSciPy

[Numpy-discussion] Euroscipy 2012 - Brussels - August 23-37 - call for abstracts

2012-02-12 Thread Emmanuelle Gouillart
- Emmanuelle Gouillart - Kael Hanson - Konrad Hinsen - Hans Petter Langtangen

[Numpy-discussion] [ANN] Euroscipy 2011 - registration now open

2011-06-25 Thread Emmanuelle Gouillart
Dear all, After some delay due to technical problems, registration for Euroscipy 2011 is now open! Please go to http://www.euroscipy.org/conference/euroscipy2011, login to your account if you have one, or create a new account (right side of the upper banner of the Euroscipy webpage), then

[Numpy-discussion] [ANN] PyPhy - Python in Physics - Satellite of Euroscipy 2011

2011-05-28 Thread Emmanuelle Gouillart
Bottani (MSC, Paris Diderot) * Gianfranco Durin (ISI, Turin) * Emmanuelle Gouillart (Saint-Gobain Research) * Konrad Hinsen (CBM Université d'Orleans) * Vivien Lecomte (LPMA Paris Diderot) * Chris Myers (Department of Physics, Cornell University) * Michael Schindler (LPCT, EPSCI, Paris) * Georg

[Numpy-discussion] strange behavior of np.minimum and np.maximum

2011-04-06 Thread Emmanuelle Gouillart
Hello, a, b, c = np.array([10]), np.array([2]), np.array([7]) min_val = np.minimum(a, b, c) min_val array([2]) max_val = np.maximum(a, b, c) max_val array([10]) min_val array([10]) (I'm using numpy 1.4, and I observed the same behavior with numpy 2.0.0.dev8600 on another machine).

Re: [Numpy-discussion] strange behavior of np.minimum and np.maximum

2011-04-06 Thread Emmanuelle Gouillart
Hi Zach and Derek, thank you very much for your quick and clear answers. Of course the third parameter is the out array, I was just being very stupid! (I had read the documentation though, but somehow it didn't make it to my brain :-) Sorry... Read the documentation for numpy.minimum and

Re: [Numpy-discussion] Broadcasting and indexing

2010-01-21 Thread Emmanuelle Gouillart
Hi Thomas, broadcasting rules are only for ufuncs (and by extension, some numpy functions using ufuncs). Indexing obeys different rules and always starts by the first dimension. However, you don't have to use broadcasting for such indexing operations: a[:, c] = 0 zeroes columns indexed by c.

Re: [Numpy-discussion] extracting data from ODF files

2010-01-05 Thread Emmanuelle Gouillart
Hi Manuel, you may save your odf file as a csv (comma separated value) file with OpenOffice, then use np.loadtxt, specifying the 'delimiter' keyword: myarray = np.loadtxt('myfile.csv', delimiter=',') Cheers, Emmanuelle On Tue, Jan 05, 2010 at 10:14:54PM +0100, Manuel Wittchen wrote: Hi, is

Re: [Numpy-discussion] calculating the difference of an array

2010-01-02 Thread Emmanuelle Gouillart
Hello Manuel, the discrete difference of a numpy array can be written in a very natural way, without loops. Below are two possible ways to do it: a = np.arange(10)**2 a array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81]) a[1:] - a[:-1] array([ 1, 3, 5, 7, 9, 11, 13, 15, 17]) np.diff(a) #

Re: [Numpy-discussion] combinatorial operations on a pair of arrays

2009-11-18 Thread Emmanuelle Gouillart
Hello Damien, broadcasting can solve your problem (see http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html): (A[np.newaxis,:]**B[:,np.newaxis]).sum(axis=0) gives the result you want. (assuming import numpy as np, which is considered as a better practice as from numpy import *)

Re: [Numpy-discussion] finding range of values below threshold in sorted array

2009-08-14 Thread Emmanuelle Gouillart
Hi, ind = np.searchsorted(A, b) values = A[:ind] Cheers, Emmanuelle On Fri, Aug 14, 2009 at 02:27:23PM +0200, Mark Bakker wrote: Hello List, I am trying to find a quick way to do the following: I have a *sorted* array of real numbers, say array A, sorted in ascending order

Re: [Numpy-discussion] Power distribution

2009-08-08 Thread Emmanuelle Gouillart
On Fri, Aug 07, 2009 at 11:55:45PM -0400, josef.p...@gmail.com wrote: On Fri, Aug 7, 2009 at 10:17 PM, a...@ajackson.org wrote: Thanks! That helps a lot. Thanks for improving the docs. Many thanks for taking the time of finding out what this distribution really is, and improving the docs. I

Re: [Numpy-discussion] speed of atleast_1d and friends

2009-08-04 Thread Emmanuelle Gouillart
Hello, I am making a lot of use of atleast_1d and atleast_2d in my routines. Does anybody know whether this will slow down my code significantly? if there is no need to make copies (i.e. if you take arrays as parameters (?)), calls to atleast_1d and atleast_2d should be

Re: [Numpy-discussion] strange sin/cos performance

2009-08-03 Thread Emmanuelle Gouillart
Hi Andrew, %timeit is an Ipython magic command that uses the timeit module, see http://ipython.scipy.org/doc/stable/html/interactive/reference.html?highlight=timeit for more information about how to use it. So you were right to suppose that it is not a normal Python.

Re: [Numpy-discussion] strange sin/cos performance

2009-08-03 Thread Emmanuelle Gouillart
import numpy as np a = np.arange(0.0, 1000, (2 * 3.14159) / 1000, dtype=np.float32) b = np.arange(0.0, 1000, (2 * 3.14159) / 1000, dtype=np.float64) %timeit -n 10 np.sin(a) 10 loops, best of 3: 8.67 ms per loop %timeit -n 10 np.sin(b) 10 loops, best of 3: 9.29 ms per loop OK, I'm

Re: [Numpy-discussion] strange sin/cos performance

2009-08-03 Thread Emmanuelle Gouillart
On Mon, Aug 03, 2009 at 08:17:21AM -0700, Keith Goodman wrote: On Mon, Aug 3, 2009 at 7:21 AM, Emmanuelle Gouillartemmanuelle.gouill...@normalesup.org wrote: import numpy as np a = np.arange(0.0, 1000, (2 * 3.14159) / 1000, dtype=np.float32) b = np.arange(0.0, 1000, (2 * 3.14159) /

[Numpy-discussion] Numpy/Scipy and the Python African Tour

2009-07-23 Thread Emmanuelle Gouillart
Dear users of Numpy and Scipy, here is an informal report on the last event of the Python African Tour, which took place in Dakar (Senegal) on July 6-10th. It might interest only a fraction of the lists, so I apologize for the spamming. What is the Python African Tour?

[Numpy-discussion] np.memmap and memory usage

2009-07-01 Thread Emmanuelle Gouillart
Hello, I'm using numpy.memmap to open big 3-D arrays of Xray tomography data. After I have created a new array using memmap, I modify the contrast of every Z-slice (along the first dimension) inside a for loop, for a better visualization of the data. Although I call memmap.flush

Re: [Numpy-discussion] np.memmap and memory usage

2009-07-01 Thread Emmanuelle Gouillart
Hi Pauli, thank you for your answer! I was indeed measuring the memory used with top, which is not the best tool for understanding what really happens. I monitored free during the execution of my program and indeed, the used numbers on the +/-buffers/cache line stays roughly

Re: [Numpy-discussion] np.memmap and memory usage

2009-07-01 Thread Emmanuelle Gouillart
run also quite well on my computer. I'll let you know! Thanks again, Emmanuelle On Wed, Jul 01, 2009 at 03:04:08PM +0200, Francesc Alted wrote: A Wednesday 01 July 2009 10:17:51 Emmanuelle Gouillart escrigué: Hello, I'm using numpy.memmap to open big 3-D arrays

Re: [Numpy-discussion] interleaving arrays

2009-06-14 Thread Emmanuelle Gouillart
a = np.empty(3*n.size, np.int) a[::3]=n a[1::3]=m a[2::3]=o or np.array(zip(n,m,o)).ravel() but the first solution is faster, even if you have to write more :D Emmanuelle On Sun, Jun 14, 2009 at 04:11:29PM +0200, Robert wrote: whats the right way to efficiently weave arrays like this ? :

Re: [Numpy-discussion] finding index in an array...

2009-06-13 Thread Emmanuelle Gouillart
Hi Fred, here is another solution A = np.arange(99).reshape((33,3) mask = (A==np.array([0,1,2])) np.nonzero(np.prod(mask, axis=1))[0] array([0] I found it to be less elegant than Josef's solution changing the dtype of the array, but it may be easier to understand if you're not very familiar

Re: [Numpy-discussion] Question about slicing

2009-05-16 Thread Emmanuelle Gouillart
Hi Jorge, roi = aimg[10:20,45:50,:] are you working with 3-D images? I didn't know PIL was able to handle 3D images. I wasn't able to reproduce the behavior you observed with a simple example: In [20]: base = np.arange(25).reshape((5,5)) In [21]: base Out[21]: array([[ 0, 1, 2, 3, 4],

Re: [Numpy-discussion] need some help with python scientific packages

2009-04-21 Thread Emmanuelle Gouillart
Hi Nacer, I read your message on the african python tour mailing list. I am looking for someone able to help me find the right scientific package for parallel computing (data mining of frequent patterns). I am involve in a DEA course and need such a package to illustrate the topics I

Re: [Numpy-discussion] optimising single value functions for array calculations

2008-12-01 Thread Emmanuelle Gouillart
Hello Timmie, numpy.vectorize(myfunc) should do what you want. Cheers, Emmanuelle Hello, I am developing a module which bases its calculations on another specialised module. My module uses numpy arrays a lot. The problem is that the other module I am building upon, does not work with

Re: [Numpy-discussion] computing average distance

2008-11-02 Thread Emmanuelle Gouillart
Hello Paul, although I'm not an expert either, it seems to me you could improve your code a lot by using numpy.mgrid Below is a short example of what you could do coordinates = numpy.mgrid[0:R, 0:R, 0:R] X, Y, Z = coordinates[0].ravel(), coordinates[1].ravel(),coordinates[2].ravel() bits =