[Numpy-discussion] FAIL: Test corrcoef 1 1D variable w/missing values

2008-08-06 Thread Nils Wagner
Hi all, Can someone reproduce the failure with >>> numpy.__version__ '1.2.0.dev5618' == FAIL: Test corrcoef 1 1D variable w/missing values -- Traceback (most re

Re: [Numpy-discussion] Horizontal lines in diffraction image (NumPyFFT)

2008-08-06 Thread Nadav Horesh
The 0 padding is easy in numpp/pylab as in octave/matlab, by just adding one argument. In pylab it is the "a" keyword: y = fft(x, n=2*len(x)) if n is not given then n=len(x) --- normal fft if n > len(x) then it pads x with 0. Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Matthias

Re: [Numpy-discussion] Horizontal lines in diffraction image (NumPy FFT)

2008-08-06 Thread Matthias Hillenbrand
Hello, > When you convolve two signals, of lengths N and M, you need to pad the > FFTs to length (N+M-1) before multiplication. > You can take a look at my linear position-invariant filtering code at: > http://mentat.za.net/hg/filter I understand your comments that I need zero padding when doin

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread Anne Archibald
2008/8/6 Eric Firing <[EMAIL PROTECTED]>: > While I agree with the other posters that "import *" is not preferred, > if you want to use it, the solution is to use amin and amax, which are > provided precisely to avoid the conflict. Just as arange is a numpy > analog of range, amin and amax are nu

Re: [Numpy-discussion] What happened to numpy.testing.Tester ?

2008-08-06 Thread robert . kern
Tester is a class, not a module. Try "from numpy.testing import Tester". On 2008-08-06, Robert Pyle <[EMAIL PROTECTED]> wrote: > > On Aug 6, 2008, at 4:17 PM, Alan McIntyre wrote: > >> You will actually need to use NumPy from svn as well, since 1.1.1 >> didn't have NoseTester (SciPy 0.7 will requi

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread mark
Thanks for the encouragement to try to dive deeper into namespaces, but also thanks for the amin, amax suggestions. Mark On Aug 6, 8:21 pm, Eric Firing <[EMAIL PROTECTED]> wrote: > mark wrote: > > Hello list. I am confused about importing numpy. > > > When I do > > > from numpy import * > > > and

Re: [Numpy-discussion] What happened to numpy.testing.Tester ?

2008-08-06 Thread Robert Pyle
On Aug 6, 2008, at 4:17 PM, Alan McIntyre wrote: > You will actually need to use NumPy from svn as well, since 1.1.1 > didn't have NoseTester (SciPy 0.7 will require NumPy 1.2). Thanks. I can now import scipy, but I'm puzzled by the following: Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [

Re: [Numpy-discussion] Calculating roots with negative numbers

2008-08-06 Thread Matthias Hillenbrand
Sorry, I have chosen the wrong title for this email. It should be a follow up to the discussion 'Horizontal lines in diffraction image (NumPy FFT)' ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/nu

Re: [Numpy-discussion] What happened to numpy.testing.Tester ?

2008-08-06 Thread Alan McIntyre
On Wed, Aug 6, 2008 at 3:57 PM, Robert Pyle <[EMAIL PROTECTED]> wrote: > My machine: Mac dual G5, OSX 10.5.4, Python 2.5.2 (r252:60911, Feb 22 > 2008, 07:57:53), numpy 1.1.1 > > After considerable agony, I succeeded in building and installing scipy > from SVN, only to be told upon importing it: > >

[Numpy-discussion] What happened to numpy.testing.Tester ?

2008-08-06 Thread Robert Pyle
Hi all, My machine: Mac dual G5, OSX 10.5.4, Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53), numpy 1.1.1 After considerable agony, I succeeded in building and installing scipy from SVN, only to be told upon importing it: Traceback (most recent call last): File "", line 1, in File "/

Re: [Numpy-discussion] Calculating roots with negative numbers

2008-08-06 Thread Matthias Hillenbrand
Hello, > When you convolve two signals, of lengths N and M, you need to pad the > FFTs to length (N+M-1) before multiplication. > You can take a look at my linear position-invariant filtering code at: > http://mentat.za.net/hg/filter I understand your comments that I need zero padding when doi

[Numpy-discussion] Functions that stores results without using the out keyword

2008-08-06 Thread Bruce Southey
Hi, The following functions support a optional second argument that stores the result: isfinite, isnan, isinf, isposinf and isneginf. There may be other functions with the same behavior. Is this usage equivalent to 'out' keyword that appears in other functions like mean? If so, should these fun

Re: [Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Christopher Hanley
Nadav Horesh wrote: > You can access nd_image by: > > from numpy.numarray import nd_image > > but as Zach noted, scipy.interpolate is what you are looking for. > > Nadav. > The ndimage modules is now officially supported by the scipy project. You can get it from scipy.ndimage(). Chris --

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread Eric Firing
mark wrote: > Hello list. I am confused about importing numpy. > > When I do > > from numpy import * > > and I try the min function, I get the default Python min function. > > On the other hand, when I do > > import numpy as np > > and use the np.min function, I get the numpy min function (wh

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Tom Denniston
I think the square brackets are very confusing as a numpy user not familiar with CPython. On 8/6/08, Christopher Barker <[EMAIL PROTECTED]> wrote: > Dag Sverre Seljebotn wrote: > > cdef numpy.ndarray[numpy.int64, ndim=2] > > +1 it's very clear what this means. I think the keyword should be require

Re: [Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Gary Ruben
You're best off using scipy. Just Google search for "scipy spline": e.g. Gary R. Gong, Shawn (Contractor) wrote: > hi list, > > I am trying to find 1-D cubic spline function. But I

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread Christopher Barker
mark wrote: > I guess that makes sense on a certain level, but boy it is cumbersome > to explain to a class. > It pretty much defeats the whole purpose of doing from numpy import *. which is fine by me: "Namespaces are one honking great idea -- let's do more of those!" explain namespaces to your

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Christopher Barker
Dag Sverre Seljebotn wrote: > cdef numpy.ndarray[numpy.int64, ndim=2] +1 it's very clear what this means. I think the keyword should be required. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way N

Re: [Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Gong, Shawn (Contractor)
Thank you both, Nadav and Zach. Shawn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nadav Horesh Sent: Wednesday, August 06, 2008 12:16 PM To: Discussion of Numerical Python Subject: RE: [Numpy-discussion] cubic spline function in numarray or numpy Yo

Re: [Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread James Turner
Hi Shawn, > I am trying to find 1-D cubic spline function. But I am not able to call > it. Error message can’t find “ndimage” Ndimage is a module in SciPy, so you'd need to install that first, not just NumPy. I'm not really familar with the available 1-D cubic spline functions, but I think you w

[Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Gong, Shawn (Contractor)
hi list, I am trying to find 1-D cubic spline function. Google search yields that there is a function called spline_filter1d in numarray. But I am not able to call it. Would someone point me to 1-D cubic spline function either in numarray or numpy? I can find source codes and enter in Python. B

Re: [Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Nadav Horesh
You can access nd_image by: from numpy.numarray import nd_image but as Zach noted, scipy.interpolate is what you are looking for. Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם Zachary Pincus נשלח: ד 06-אוגוסט-08 19:09 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion]

Re: [Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Zachary Pincus
Hi Shawn, > I am trying to find 1-D cubic spline function. But I am not able to > call it. Error message can’t find “ndimage” > Numpy provides tools for creating and dealing with multidimensional arrays and some basic FFT and linear algebra functions. You want to look at scipy, a set of pa

Re: [Numpy-discussion] f2py: undefined symbol: zgemm_

2008-08-06 Thread Harry Mangalam
The problem seems to have been a conflicting version of liblapack. I installed a newer version of liblapack (liblapack-dev, from the Ubuntu 8.04 tree) and recompiled and that seems to have addressed the issue. Even tho the previously offending symbols are still undefined, the wrapped code does

[Numpy-discussion] dot/inner with kwargs?

2008-08-06 Thread Hans Meine
Hi, I am trying to do something like the following as efficiently as possible: result[...,0] = (dat * cos(arange(100))).sum(axis = -1) result[...,1] = (dat * sin(arange(100))).sum(axis = -1) Thus, I was looking for dot / inner with an 'output' arg. Q1: What is the difference between dot and inne

[Numpy-discussion] cubic spline function in numarray or numpy

2008-08-06 Thread Gong, Shawn (Contractor)
hi list, I am trying to find 1-D cubic spline function. But I am not able to call it. Error message can't find "ndimage" Would someone point me to 1-D cubic spline functions either in numarray or numpy? and their help pages? I use python 2.3.5 and numpy 1.0.1. Are they too old to use cubic splin

Re: [Numpy-discussion] Segfault in PyArray_Item_XDECREF when using recarray object references titles

2008-08-06 Thread Michael Droettboom
I've filed a bug, with a patch to address all these issues, here: http://scipy.org/scipy/numpy/ticket/877 Cheers, Mike Michael Droettboom wrote: > I also noticed that the inverse operation, PyArray_Item_INCREF has the > potential to leak memory as it will doubly-increment each object in the >

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Dag Sverre Seljebotn
Dag Sverre Seljebotn wrote: > Travis E. Oliphant wrote: >> Gael Varoquaux wrote: >>> On Wed, Aug 06, 2008 at 10:35:06AM +0200, Dag Sverre Seljebotn wrote: >>> Stéfan van der Walt wrote: > 2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: > >> - Require an ndim

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Dag Sverre Seljebotn
Travis E. Oliphant wrote: > Gael Varoquaux wrote: >> On Wed, Aug 06, 2008 at 10:35:06AM +0200, Dag Sverre Seljebotn wrote: >> >>> Stéfan van der Walt wrote: >>> 2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: > - Require an ndim keyword: > >> > cd

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Travis E. Oliphant
Gael Varoquaux wrote: > On Wed, Aug 06, 2008 at 10:35:06AM +0200, Dag Sverre Seljebotn wrote: > >> Stéfan van der Walt wrote: >> >>> 2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: >>> - Require an ndim keyword: > > cdef numpy.ndarray[numpy.int64, ndim=2

Re: [Numpy-discussion] Slicing without a priori knowledge of dimension

2008-08-06 Thread Matthew Czesarski
Dear Hoyt, Thanks -- that hit the spot! Looks like it was a case of me looking for the answer in the wrong place. Assuming that there would be some sophisticated numpy method -- E.g. A.dim_slice( ( 2,5,... ) ) -- that slices up the array and gives you back the sub-full dimensional matrix you're l

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Gael Varoquaux
On Wed, Aug 06, 2008 at 10:35:06AM +0200, Dag Sverre Seljebotn wrote: > Stéfan van der Walt wrote: > > 2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: > >> - Require an ndim keyword: > >> cdef numpy.ndarray[numpy.int64, ndim=2] > > I'd definitely prefer a comma between the two, and an (optiona

Re: [Numpy-discussion] Slicing without a priori knowledge of dimension

2008-08-06 Thread Hoyt Koepke
Try using slice (python builtin) to create slice objects (what is created implicitly by :5, 1:20, etc.). slice takes the same arguments as range. A list of these (7 in your case) can then be passed to A[...] as a tuple. That's how I would do it, but maybe someone else has a better idea or can co

[Numpy-discussion] Slicing without a priori knowledge of dimension

2008-08-06 Thread Matthew Czesarski
Dear list. I've got a feeling that what I'm trying to do *should* be easy but at the moment I can't find a non-brute-force method. I'm working with quite a high-rank matrix; 7 dimensions filled with chi**2 values. It's form is something like this: chi2 = numpy.ones((3,4,5,6,7,8,9)) What I n

[Numpy-discussion] unique1d returning indices

2008-08-06 Thread Robert Cimrman
Hi, due to popular demand, I have updated unique1d() to optionally return both kinds of indices: In [3]: b, i, j = nm.unique1d( a, return_index=True, return_inverse=True ) In [4]: a Out[4]: array([1, 1, 8, 3, 3, 5, 4]) In [6]: b Out[6]: array([1, 3, 4, 5, 8]) In [7]: a[i] Out[7]: array([1,

Re: [Numpy-discussion] member1d and unique elements

2008-08-06 Thread Robert Cimrman
Hi Greg, Greg Novak wrote: > Argh. I could swear that yesterday I typed test cases just like the > one you provide, and it behaved correctly. Nevertheless, it clearly > fails in spite of my memory, so attached is a version which I believe > gives the correct behavior. It looks ok now, although

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread Bill Baxter
Anything that defeats the purpose of doing * imports is good in my book. :-) Seriously, willy nilly import of any package into the base namespace is just asking for trouble. Tell your class to import numpy as np, then there will be no chance of confusion. Then later tell them about "from numpy i

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread mark
I guess that makes sense on a certain level, but boy it is cumbersome to explain to a class. It pretty much defeats the whole purpose of doing from numpy import *. Mark On Aug 6, 12:03 pm, "Robert Kern" <[EMAIL PROTECTED]> wrote: > On Wed, Aug 6, 2008 at 05:00, mark <[EMAIL PROTECTED]> wrote: > >

Re: [Numpy-discussion] Horizontal lines in diffraction image (NumPy FFT)

2008-08-06 Thread Stéfan van der Walt
2008/8/6 Matthieu Brucher <[EMAIL PROTECTED]>: > Exactly. Using FFT to do a convolution should be done after some > signal processing readings ;) When you convolve two signals, of lengths N and M, you need to pad the FFTs to length (N+M-1) before multiplication. You can take a look at my linear p

Re: [Numpy-discussion] confusion on importing numpy

2008-08-06 Thread Robert Kern
On Wed, Aug 6, 2008 at 05:00, mark <[EMAIL PROTECTED]> wrote: > Hello list. I am confused about importing numpy. > > When I do > > from numpy import * > > and I try the min function, I get the default Python min function. > > On the other hand, when I do > > import numpy as np > > and use the np.mi

[Numpy-discussion] confusion on importing numpy

2008-08-06 Thread mark
Hello list. I am confused about importing numpy. When I do from numpy import * and I try the min function, I get the default Python min function. On the other hand, when I do import numpy as np and use the np.min function, I get the numpy min function (which is obviously what I want). I know

Re: [Numpy-discussion] Horizontal lines in diffraction image (NumPy FFT)

2008-08-06 Thread Matthieu Brucher
Exactly. Using FFT to do a convolution should be done after some signal processing readings ;) (That's why I hate FFT to do signal processing as well). Matthieu 2008/8/6 Nadav Horesh <[EMAIL PROTECTED]>: > > I did about the same thing 9 year ago (in python of course). If I can recall > correctly

Re: [Numpy-discussion] Numpy random: independent streams

2008-08-06 Thread Robert Kern
On Wed, Aug 6, 2008 at 04:30, Ludwig <[EMAIL PROTECTED]> wrote: > The Python standard random API allows me to define multiple independent > random streams, which I can control with their own seed, e.g. > > import random > generator_1 = random.Random() > generator_2 = random.Random() > > generator_1

[Numpy-discussion] Numpy random: independent streams

2008-08-06 Thread Ludwig
The Python standard random API allows me to define multiple independent random streams, which I can control with their own seed, e.g. import random generator_1 = random.Random() generator_2 = random.Random() generator_1.seed(100) generator_2.seed(100) So now generator_1 and 2 will produce the sa

[Numpy-discussion] win32 1.1.1 testsuite issue with python -O

2008-08-06 Thread Jon Wright
Hello, If I use the "-O" switch then it seems getting some testcase failures, and finally a windows message that "python.exe has encountered a problem and needs to close. We are sorry for the inconvenience.". Running the testsuite via jepp (jepp.sourceforge.net) gives the same failures, plus

Re: [Numpy-discussion] Horizontal lines in diffraction image (NumPy FFT)

2008-08-06 Thread Nadav Horesh
I did about the same thing 9 year ago (in python of course). If I can recall correctly, you need to double the arrays size (with padding of 0) in order to avoid this artifact. I think that its origin is that the DFT is equivalent to periodic boundary conditions. Nadav. -הודעה מקורית

Re: [Numpy-discussion] Bilateral filter

2008-08-06 Thread Nadav Horesh
I made the following modification to the source code, I hope it is ready to be included in scipy. 1. Added a BSD licence declaration. 2. Small optimisation. 3. The code is split into a cython back-end and a python front-end. All remarks are welcome, Nadav. On Tue, 20

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Stéfan van der Walt
2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: >>> cdef numpy.ndarray[numpy.int64, ndim=2] >> >> I'd definitely prefer a comma between the two, and an (optional) ndim >> keyword argument if possible. > > I'm taking this as a vote in favor of this and against "2D" and <>? > > The keyword is alre

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Dag Sverre Seljebotn
Stéfan van der Walt wrote: > 2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: >> - Require an ndim keyword: >> >> cdef numpy.ndarray[numpy.int64, ndim=2] > > I'd definitely prefer a comma between the two, and an (optional) ndim > keyword argument if possible. I'm taking this as a vote in favor

Re: [Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Stéfan van der Walt
2008/8/6 Dag Sverre Seljebotn <[EMAIL PROTECTED]>: > - Require an ndim keyword: > > cdef numpy.ndarray[numpy.int64, ndim=2] I'd definitely prefer a comma between the two, and an (optional) ndim keyword argument if possible. Looking forward to hearing more! Regards Stéfan

[Numpy-discussion] Cython/NumPy syntax

2008-08-06 Thread Dag Sverre Seljebotn
I'd like input from anyone interested in the following syntax questions. The current experimental Cython syntax for efficient ndarray indexing looks like this: cdef numpy.ndarray[numpy.int64, 2] arr Issue 1: One can argue that "2" above looks like a length specifier to newcomers. Issue 2: Thi