Re: [Numpy-discussion] lfilter

2008-12-20 Thread Joris De Ridder
On 19 Dec 2008, at 17:10 , Sturla Molden wrote: I am wondering if not scipy.signal.lfilter ought to be a part of the core NumPy. Note that it is similar to the filter function found in Matlab, and it makes a complement to numpy.convolve. May I suggest that it is renamed or aliased to

Re: [Numpy-discussion] np.loadtxt : yet a new implementation...

2008-12-02 Thread Joris De Ridder
On 1 Dec 2008, at 21:47 , Stéfan van der Walt wrote: Hi Pierre 2008/12/1 Pierre GM [EMAIL PROTECTED]: * `genloadtxt` is the base function that makes all the work. It outputs 2 arrays, one for the data (missing values being substituted by the appropriate default) and one for the mask. It

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

2008-11-25 Thread Joris De Ridder
On 24 Nov 2008, at 19:45 , Francesc Alted wrote: standards in computer science. For example, where Python writes: asin, acos, atan, asinh, acosh, atanh NumPy choose: arcsin, arccos, arctan, arcsinh, arccosh, arctanh So, IMHO, I think it would be better to rename the inverse

Re: [Numpy-discussion] statistical model fitting comparison

2008-10-22 Thread Joris De Ridder
Thanks for the pointers. I'll produce some code to show what I have in mind, and then come back to the list. Cheers, Joris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

[Numpy-discussion] statistical model fitting comparison

2008-10-20 Thread Joris De Ridder
Hi, I'm interested in developing some general-use Python/Numpy code for linear model fitting and comparison. The fitting is easy enough with Numpy, but the automated comparison of the submodels to identify which model describes best the data, requires some work. Before I embark on this, I

Re: [Numpy-discussion] The NumPy Cython release + tutorial

2008-08-21 Thread Joris De Ridder
On 20 Aug 2008, at 22:18 , Dag Sverre Seljebotn wrote: Cython just had a release, and amongst the new features are efficient NumPy array indexing for integers, real floats and Python objects. You can get it at http://cython.org For those new to Cython, I've written a tutorial specifically

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Joris De Ridder
Hi Dag, General feedback is welcome; in particular, I need more opinions about what syntax people would like. We seem unable to find something that we really like; this is the current best candidate (cdef is the way you declare types on variables in Cython): cdef int i = 4, j = 6 cdef

Re: [Numpy-discussion] segmentation fault

2008-05-28 Thread Joris De Ridder
On 28 May 2008, at 16:30, Keith Goodman wrote: Does anyone else get this seg fault? def fn(): x = np.random.rand(5,2) x.cumsum(None, out=x) return x : fn() *** glibc detected *** /usr/bin/python: double free or corruption (out): 0x08212dc8 *** I'm running 1.0.4 from

Re: [Numpy-discussion] Going toward time-based release ?

2008-05-12 Thread Joris De Ridder
On 12 May 2008, at 04:59, David Cournapeau wrote: Also, time-based releases are by definition predictable, and as such, it is easier to plan upgrades for users As long as it does not imply that users have to upgrade every 3 months, because for some users this is impossible and/or

Re: [Numpy-discussion] Using normal()

2008-04-24 Thread Joris De Ridder
On 24 Apr 2008, at 19:26, Rich Shepard wrote: norm = 1 / (scale * sqrt(2 * pi)) y = norm * exp(-power((x - loc), 2) / (2 * scale**2)) Can do. So, scale would equate to width and loc to center, yes? Scale is half the width between the inflection points, mind the factor of 2. J.

Re: [Numpy-discussion] access ndarray in C++

2008-04-23 Thread Joris De Ridder
They are attached to the wiki page. Click on Attachments in the menu on the left. Joris On 23 Apr 2008, at 17:19, Tommy Grav wrote: On Apr 22, 2008, at 9:56 PM, Joris De Ridder wrote: On http://www.scipy.org/JorisDeRidder I've just put an example how I passed multidimensional Numpy

Re: [Numpy-discussion] access ndarray in C++

2008-04-23 Thread Joris De Ridder
On 23 Apr 2008, at 17:50, Tommy Grav wrote: On Apr 23, 2008, at 11:26 AM, Joris De Ridder wrote: They are attached to the wiki page. Click on Attachments in the menu on the left. Joris Thanks. Didn't know that wiki's had that :) I tried you example on a Mac OS X 10.5.2 (I am

Re: [Numpy-discussion] Release of NumPy

2008-04-17 Thread Joris De Ridder
On 17 Apr 2008, at 01:09, Stéfan van der Walt wrote: Split infinitive -- I'd get in trouble for that. Please use the latest patch (attached), which fixes a bug with assignment. I experimented with returning an (N,) array when converting using vector.A, but I'm not convinced that that is

Re: [Numpy-discussion] packaging scipy (was Re: Simple financial functions for NumPy)

2008-04-10 Thread Joris De Ridder
On 10 Apr 2008, at 05:21, Travis E. Oliphant wrote: Right now it looks like there is a mix of attitudes, about the financial functions. They are a small enough addition, that I don't think it matters terribly much what we do with them. So, it seems to me that keeping them in numpy.lib

Re: [Numpy-discussion] #734: interactive docstring search (lookfor)

2008-04-10 Thread Joris De Ridder
On 10 Apr 2008, at 23:23, Travis E. Oliphant wrote: Cool. I started scipy.misc.info a long time ago to try and do this. I didn't advertise it well enough ;-) Yep, I also started to write my own docsearch tool but neglected to advertise it. On 10 Apr 2008, at 23:58, Gael Varoquaux

Re: [Numpy-discussion] Simple financial functions for NumPy

2008-04-04 Thread Joris De Ridder
On 04 Apr 2008, at 16:11, Travis E. Oliphant wrote: snip There are only two reasons that I can think of right now to keep them in NumPy instead of moving them to SciPy. 1) These are basic functions and a scipy toolkit would contain much more. Isn't this something you want to avoid?

Re: [Numpy-discussion] Quikest way to create a diagonal matrix ?

2008-03-26 Thread Joris De Ridder
On 26 Mar 2008, at 15:36, lorenzo bolla wrote: numpy.tri In [31]: T = numpy.tri(m) In [32]: z.T * T + z * T.T Out[32]: array([[ 0., 1., 2., 3., 4.], [ 1., 12., 7., 8., 9.], [ 2., 7., 24., 13., 14.], [ 3., 8., 13., 36., 19.], [

Re: [Numpy-discussion] numpy.any segfaults for large object arrays

2008-03-24 Thread Joris De Ridder
I cannot confirm the problem on my intel macbook pro using the same Python and Numpy versions. Although any(numpy.array(large_none)) takes a significantly longer time than any(numpy.array(large_zero)), the former does not segfault on my machine. J. On 24 Mar 2008, at 14:05, Martin

Re: [Numpy-discussion] numpy.any segfaults for large object arrays

2008-03-24 Thread Joris De Ridder
On 24 Mar 2008, at 18:27, Martin Manns wrote: I cannot confirm the problem on my intel macbook pro using the same Python and Numpy versions. Although any(numpy.array(large_none)) takes a significantly longer time than any(numpy.array(large_zero)), the former does not segfault on my

Re: [Numpy-discussion] Help needed with numpy 10.5 release blockers

2008-03-21 Thread Joris De Ridder
On 21 Mar 2008, at 12:29, Sebastian Haase wrote: ... and what does the p stand for in N.intp type 'numpy.int32' It stands for pointer. An intp is an integer large enough to contain a pointer address. J. Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Re: [Numpy-discussion] dunno what array operation I'm looking for...

2008-03-21 Thread Joris De Ridder
numpy.diff See http://www.scipy.org/Numpy_Example_List J. On 22 Mar 2008, at 03:43, Chris Withers wrote: Hi All, Say I have an array like: measurements = array([100,109,115,117]) What do I do to it to get: array([9, 6, 2]) Is the following really the best way? result = [] for i

Re: [Numpy-discussion] Improving Docs on Wiki

2008-03-21 Thread Joris De Ridder
On 21 Mar 2008, at 18:22, Joe Harrington wrote: What you have brought up is really a documentation problem: how do I find the name of the routine I want? One way of dealing with this, could be the implementation of a doc() function in numpy that helps you to find what you want. A (still

Re: [Numpy-discussion] C++ class encapsulating ctypes-numpy array?

2008-03-20 Thread Joris De Ridder
array, it is implemented in terms of a Numpy array (http://matt.eifelle.com/item/5) Matthieu2008/3/19, Joris De Ridder [EMAIL PROTECTED]>: Hi, I'm passing (possibly non-contiguous) numpy arrays (data + shape + strides + ndim) with ctypes to my C++ function (with external "C" to make ctypes happy).

[Numpy-discussion] C++ class encapsulating ctypes-numpy array?

2008-03-19 Thread Joris De Ridder
Hi, I'm passing (possibly non-contiguous) numpy arrays (data + shape + strides + ndim) with ctypes to my C++ function (with external C to make ctypes happy). Has anyone made a C++ class derived from a ctypes- numpy-array with an overloaded [] operator to allow easy indexing (e.g.

Re: [Numpy-discussion] subset of array - statistics

2008-03-13 Thread Joris De Ridder
I am new to the world of Python and numpy Welcome. I have successfully imported the data into lists and then created a single array from the lists. I think putting each quantity in a 1D array is more practical in this case. I can get the rainfall total over the entire period using:

Re: [Numpy-discussion] Numpy/Cython Google Summer of Code project idea

2008-03-07 Thread Joris De Ridder
On 07 Mar 2008, at 10:02, Fernando Perez wrote: Chris B gave what I think is a good reply to this, but feel free to ask if you have further questions. I think it's important that we reach some consensus on why this a good idea on technical grounds without anyone feeling like the decision is

Re: [Numpy-discussion] Numpy/Cython Google Summer of Code project idea

2008-03-06 Thread Joris De Ridder
On 06 Mar 2008, at 19:15, Fernando Perez wrote: http://www.cython.org/ is an evolved version of Pyrex (which is used by numpy and scipy) with lots of improvements. We'd like to position Cython as the preferred way of writing most, if not all, new extension code written for numpy and scipy,

Re: [Numpy-discussion] Median advice

2008-02-12 Thread Joris De Ridder
On 12 Feb 2008, at 12:31, Matthew Brett wrote: def median(a, axis=0, out=None) (same signature as max, min etc) I would be slightly in favour of this option. Using the same signature would be convenient in code like def myfunc(myarray, somefunc): # do stuff ... x =

Re: [Numpy-discussion] Median again

2008-01-29 Thread Joris De Ridder
This feature request has been repeatedly asked before (e.g. 6 months ago). The relevant ticket (#558, although this only asks for axis support) mentions a milestone 1.1. I would like to ask if it could be moved somewhat higher on the priority list. I provided some code for axis support

Re: [Numpy-discussion] Median again

2008-01-29 Thread Joris De Ridder
On 30 Jan 2008, at 00:32, Travis E. Oliphant wrote: Matthew Brett wrote: Hi, median moved mediandim0 implementation of medianwithaxis or similar, with same call signature as mean. But - for the median function change - do we agree that this should be changed? I think it is a

Re: [Numpy-discussion] arange and floating point arguments

2007-09-15 Thread Joris De Ridder
On 14 Sep 2007, at 23:51, Robert Kern wrote: You can hide some of the surprises, but not all of them. I guess it's impossible to make a bullet-proof fix. When arange() gets a 'stop' value of 0.60009, it cannot possibly know whether this stop value is supposed to be 0.6, or

Re: [Numpy-discussion] arange and floating point arguments

2007-09-14 Thread Joris De Ridder
Might using min(ceil((stop-start)/step), ceil((stop-start)/step-r)) with r = finfo(double).resolution instead of ceil((stop-start)/step) perhaps be useful? Joris On 14 Sep 2007, at 11:37, Ed Schofield wrote: Hi everyone, This was reported yesterday as a bug in Debian's numpy package:

Re: [Numpy-discussion] arange and floating point arguments

2007-09-14 Thread Joris De Ridder
On 14 Sep 2007, at 15:54, Lou Pecora wrote: I thought this is what the linspace function was written for in numpy. Why not use that? AFAIK, linspace() is written to generate N evenly spaced numbers between start and stop inclusive. Similar but not quite the same as arange(). It works

Re: [Numpy-discussion] arange and floating point arguments

2007-09-14 Thread Joris De Ridder
the question is how to reduce user astonishment. IMHO this is exactly the point. There seems to be two questions here: 1) do we want to reduce user astonishment, and 2) if yes, how could we do this? Not everyone seems to be convinced of the first question, replying that in many cases

Re: [Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array typemap to share?

2007-09-05 Thread Joris De Ridder
A related question, just out of curiosity: is there a technical reason why Numpy has been coded in C rather than C++? Joris On 05 Sep 2007, at 02:24, David Goldsmith wrote: Anyone have a well-tested SWIG-based C++ STL valarray = numpy.array typemap to share? Thanks! DG --

[Numpy-discussion] Trac ticket

2007-08-29 Thread Joris De Ridder
Hi, Perhaps a stupid question, but I don't seem to find any info about it on the web. I would like to take up a (simple) Numpy Trac ticket, and fix it in the Numpy trunk. How can I assign the ticket to myself? After logging in, I don't see any obvious way of doing this. Secondly, committing

[Numpy-discussion] confused with apply_along_axis()

2007-02-07 Thread Joris De Ridder
Hi, I'm confused by the output of apply_along_axis() in the following very simple example: In [93]: a = arange(12.).reshape(2,2,3) In [95]: a Out[95]: array([[[ 0., 1., 2.], [ 3., 4., 5.]], [[ 6., 7., 8.], [ 9., 10., 11.]]]) In [96]: def myfunc(b):