Re: [Numpy-discussion] numpy speed question

2010-12-01 Thread Jean-Luc Menut
Le 26/11/2010 17:48, Bruce Sherwood a écrit : Although this was mentioned earlier, it's worth emphasizing that if you need to use functions such as cosine with scalar arguments, you should use math.cos(), not numpy.cos(). The numpy versions of these functions are optimized for handling array

[Numpy-discussion] Python versions for NumPy 1.5

2010-12-01 Thread John Hornstein
Does NumPy 1.5 work with Python 2.7 or Python 3.x? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] A faster median (Wirth's method)

2010-12-01 Thread John Salvatier
@Keith Goodman I think I figured it out. I believe something like the following will do what you want, iterating across one axis specially, so it can apply a median function along an axis. This code in particular is for calculating a moving average and seems to work (though I haven't checked my

Re: [Numpy-discussion] broadcasting with numpy.interp

2010-12-01 Thread greg whittier
On Wed, Nov 24, 2010 at 3:16 PM, Friedrich Romstedt friedrichromst...@gmail.com wrote: 2010/11/16 greg whittier gre...@gmail.com: I'd like to be able to speed up the following code. def replace_dead(cube, dead): # cube.shape == (320, 640, 1200) # dead.shape == (320, 640) #

[Numpy-discussion] printoption to allow hexified floats?

2010-12-01 Thread Ken Basye
Hi Numpy folks, When working with floats, I prefer to have exact string representations in doctests and other reference-based testing; I find it helps a lot to avoid chasing cross-platform differences that are really about the string conversion rather than about numerical differences.

[Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Keith Goodman
It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is typically dealt with using templates, but what do people do about the latter? I'm trying to take baby steps towards writing an apply_along_axis function that takes as input a cython

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Dag Sverre Seljebotn
On 12/01/2010 08:47 PM, Keith Goodman wrote: It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is typically dealt with using templates, but what do people do about the latter? What you typically do is to use the C-level iterator API.

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread David
Hi Keith, On 12/02/2010 04:47 AM, Keith Goodman wrote: It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is typically dealt with using templates, but what do people do about the latter? The only way that I know to do that systematically

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Keith Goodman
On Wed, Dec 1, 2010 at 5:53 PM, David da...@silveregg.co.jp wrote: On 12/02/2010 04:47 AM, Keith Goodman wrote: It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is typically dealt with using templates, but what do people do about the

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread John Salvatier
On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Dec 1, 2010 at 5:53 PM, David da...@silveregg.co.jp wrote: On 12/02/2010 04:47 AM, Keith Goodman wrote: It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former

Re: [Numpy-discussion] printoption to allow hexified floats?

2010-12-01 Thread David Warde-Farley
On 2010-12-01, at 2:18 PM, Ken Basye wrote: On a somewhat related note, is there a table someplace which shows which versions of Python are supported in each release of Numpy? I found an FAQ that mentioned 2.4 and 2.5, but since it didn't mention 2.6 or 2.7 (much less 3.1), I assume

Re: [Numpy-discussion] printoption to allow hexified floats?

2010-12-01 Thread Robert Kern
On Wed, Dec 1, 2010 at 13:18, Ken Basye kbas...@jhu.edu wrote: Hi Numpy folks,     When working with floats, I prefer to have exact string representations in doctests and other reference-based testing; I find it helps a lot to avoid chasing cross-platform differences that are really about the

[Numpy-discussion] MultiIter version of PyArray_IterAllButAxis ?

2010-12-01 Thread John Salvatier
Hello, I am writing a UFunc creation utility, and I would like to know: is there a way to mimic the behavior ofPyArray_IterAllButAxis for multiple arrays at a time? I would like to be able to write UFuncs that take an axis argument and also take multiple array arguments, for example I want to be

Re: [Numpy-discussion] MultiIter version of PyArray_IterAllButAxis ?

2010-12-01 Thread David
On 12/02/2010 12:35 PM, John Salvatier wrote: Hello, I am writing a UFunc creation utility, and I would like to know: is there a way to mimic the behavior ofPyArray_IterAllButAxis for multiple arrays at a time? Is there a reason why creating a separate iterator for each array is not

Re: [Numpy-discussion] MultiIter version of PyArray_IterAllButAxis ?

2010-12-01 Thread John Salvatier
On Wed, Dec 1, 2010 at 7:56 PM, David da...@silveregg.co.jp wrote: On 12/02/2010 12:35 PM, John Salvatier wrote: Hello, I am writing a UFunc creation utility, and I would like to know: is there a way to mimic the behavior ofPyArray_IterAllButAxis for multiple arrays at a time? Is

Re: [Numpy-discussion] A Cython apply_along_axis function

2010-12-01 Thread Robert Bradshaw
On Wed, Dec 1, 2010 at 6:09 PM, John Salvatier jsalv...@u.washington.edu wrote: On Wed, Dec 1, 2010 at 6:07 PM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Dec 1, 2010 at 5:53 PM, David da...@silveregg.co.jp wrote: On 12/02/2010 04:47 AM, Keith Goodman wrote: It's hard to write Cython