[Numpy-discussion] PyArray_EMPTY and Cython

2008-12-02 Thread Gabriel Gellner
After some discussion on the Cython lists I thought I would try my hand at writing some Cython accelerators for empty and zeros. This will involve using PyArray_EMPTY, I have a simple prototype I would like to get working, but currently it segfaults. Any tips on what I might be missing? import num

Re: [Numpy-discussion] Proposal for changing the names of inverse trigonometrical/hyperbolic functions

2008-11-24 Thread Gabriel Gellner
> There is resistance. Please don't remove the old names. Also note that > your proposed change will alter people's code in subtle, but potentially > very "interesting" ways: > > >>> from math import * > >>> from numpy import * > >>> type(arcsin(1)) is type(asin(1)) > False > >>> from numpy impo

Re: [Numpy-discussion] Proposal for changing the names of inverse trigonometrical/hyperbolic functions

2008-11-24 Thread Gabriel Gellner
On Mon, Nov 24, 2008 at 07:45:56PM +0100, Francesc Alted wrote: > Hi, > > After dealing with another issue, I realized that the names of inverse > trigonometrical/hyperbolic functions in NumPy don't follow the main > standards in computer science. For example, where Python writes: > > asin, ac

[Numpy-discussion] by axis iterator

2008-11-12 Thread Gabriel Gellner
Something I use a lot is a little generator that iterates over a ndarray by a given axis. I was wondering if this is already built-in to numpy (and not using the apply_along_axis which I find ugly) and if not would there be interest in adding it? the function is just: def by_axis(nobj, axis=0):

Re: [Numpy-discussion] setting element

2008-11-12 Thread Gabriel Gellner
On Wed, Nov 12, 2008 at 12:34:51PM -0600, Ryan May wrote: > Charles سمير Doutriaux wrote: > > Hello, > > > > I'm wondering if there's aquick way to do the following: > > > > s[:,5]=value > > > > in a "general" function > > def setval(array,index,value,axis=0): > > ## code here > > Assuming

Re: [Numpy-discussion] setting element

2008-11-12 Thread Gabriel Gellner
On Wed, Nov 12, 2008 at 09:43:34AM -0800, Charles سمير Doutriaux wrote: > Hello, > > I'm wondering if there's aquick way to do the following: > > s[:,5]=value > > in a "general" function > def setval(array,index,value,axis=0): > ## code here > > The issue is to put enough ":" before the i

Re: [Numpy-discussion] random number generation in python compared to gsl

2008-11-05 Thread Gabriel Gellner
On Wed, Nov 05, 2008 at 03:19:09PM +0100, Matthieu Brucher wrote: > > Not in this case: I always get the same sequence with seed=0 > > (different for both implementation, but the same each time I run it.) > > I got around it by installing pygsl and taking random numbers from > > there instead of fr

Re: [Numpy-discussion] [mailinglist] How to do: y[y

2008-10-27 Thread Gabriel Gellner
On Mon, Oct 27, 2008 at 12:45:44PM +0100, Uwe Schmitt wrote: > Nicolas ROUX schrieb: > > Hello, > > > > I hope this is not a silly question ;-) > > I have a Numpy array, and I want to process it with : > > "if the value is lower than Threshold, then increase by Threshold" > > > > > > I would like

Re: [Numpy-discussion] How to do: y[y

2008-10-27 Thread Gabriel Gellner
On Mon, Oct 27, 2008 at 12:41:06PM +0100, Nicolas ROUX wrote: > Hello, > > I hope this is not a silly question ;-) > I have a Numpy array, and I want to process it with : > "if the value is lower than Threshold, then increase by Threshold" > > > I would like to translate it as: > y[y You are

Re: [Numpy-discussion] ANN: Python programs for epidemic modelling

2008-10-25 Thread Gabriel Gellner
>Since, the programs are heavily using numpy, scipy and matplotlib >libraries, I send this announcement to all the three lists and the main >python-list; sorry for double-posting. The announcement with the related >links is uploaded here [1]http://blog.deductivethinking.com/?p=29. T

Re: [Numpy-discussion] (Late) summary of PEP-225 discussion at Scipy

2008-10-22 Thread Gabriel Gellner
On Wed, Oct 22, 2008 at 02:00:20PM -0700, Fernando Perez wrote: > Hi all, > > much delayed, but here it is, finally. The doc regarding our > discussion about PEP 225 is attached, and I'm keeping a public copy > for viewing convenience (with html) here: > > https://cirl.berkeley.edu/fperez/static

Re: [Numpy-discussion] var bias reason?

2008-10-15 Thread Gabriel Gellner
On Wed, Oct 15, 2008 at 09:45:39AM -0500, Travis E. Oliphant wrote: > Gabriel Gellner wrote: > > Some colleagues noticed that var uses biased formula's by default in numpy, > > searching for the reason only brought up: > > > > http://article.gmane.org/gmane.comp.py

[Numpy-discussion] var bias reason?

2008-10-15 Thread Gabriel Gellner
Some colleagues noticed that var uses biased formula's by default in numpy, searching for the reason only brought up: http://article.gmane.org/gmane.comp.python.numeric.general/12438/match=var+bias which I totally agree with, but there was no response? Any reason for this? Is there any way I can

Re: [Numpy-discussion] Record arrays

2008-06-26 Thread Gabriel Gellner
> Let's be clear, there are two very closely related things: recarrays > and record arrays. Record arrays are just ndarrays with a complicated > dtype. E.g. > > In [1]: from numpy import * > > In [2]: ones(3, dtype=dtype([('foo', int), ('bar', float)])) > Out[2]: > array([(1, 1.0), (1, 1.0), (1,