[Numpy-discussion] how to tally the values seen

2010-04-14 Thread Peter Shinners
I have an array that represents the number of times a value has been given. I'm trying to find a direct numpy way to add into these sums without requiring a Python loop. For example, say there are 10 possible values. I start with an array of zeros. counts = numpy.zeros(10, numpy.int) Now I

Re: [Numpy-discussion] how to tally the values seen

2010-04-14 Thread Gökhan Sever
On Wed, Apr 14, 2010 at 1:10 AM, Peter Shinners p...@shinners.org wrote: I have an array that represents the number of times a value has been given. I'm trying to find a direct numpy way to add into these sums without requiring a Python loop. For example, say there are 10 possible values. I

Re: [Numpy-discussion] how to tally the values seen

2010-04-14 Thread Warren Weckesser
Gökhan Sever wrote: On Wed, Apr 14, 2010 at 1:10 AM, Peter Shinners p...@shinners.org mailto:p...@shinners.org wrote: I have an array that represents the number of times a value has been given. I'm trying to find a direct numpy way to add into these sums without requiring a

Re: [Numpy-discussion] how to tally the values seen

2010-04-14 Thread Gökhan Sever
On Wed, Apr 14, 2010 at 1:34 AM, Warren Weckesser warren.weckes...@enthought.com wrote: Gökhan Sever wrote: On Wed, Apr 14, 2010 at 1:10 AM, Peter Shinners p...@shinners.org mailto:p...@shinners.org wrote: I have an array that represents the number of times a value has been

Re: [Numpy-discussion] how to tally the values seen

2010-04-14 Thread Peter Shinners
On 04/13/2010 11:44 PM, Gökhan Sever wrote: On Wed, Apr 14, 2010 at 1:34 AM, Warren Weckesser warren.weckes...@enthought.com mailto:warren.weckes...@enthought.com wrote: Gökhan Sever wrote: On Wed, Apr 14, 2010 at 1:10 AM, Peter Shinners p...@shinners.org

[Numpy-discussion] look for value, depending to y position

2010-04-14 Thread ioannis syntychakis
Hallo everybody maybe somebody can help with the following: i'm using numpy and pil to find objects in a grayscale image. I make an array of the image and then i look for pixels with the value above the 230. Then i convert the array to image and i see my objects. What i want is to make the

[Numpy-discussion] Is this a small bug in numpydoc?

2010-04-14 Thread Fernando Perez
Howdy, in ipython we use numpydoc, and as I was just trying to build the docs from a clean checkout of ipython's trunk, I kept getting errors that I was able to fix with this patch: amirbar[sphinxext] svn diff Index: numpydoc.py ===

Re: [Numpy-discussion] look for value, depending to y position

2010-04-14 Thread Nadav Horesh
I assume that you forgot to specify the range between 300 and 400. But anyway this piece of code may give you a direction: -- import numpy as np ythreshold = np.repeat(np.arange(4,-1,-1), 100) * 20 +190 bin_image = image ythreshold[:,None]

[Numpy-discussion] stdlib docstring format under discussion

2010-04-14 Thread Ralf Gommers
Hi all, On doc-sig there is a discussion going on about adopting a standard docstring format for the stdlib. The suggested format is epydoc. If you care about readability in a terminal then it may be good to join this discussion. http://mail.python.org/pipermail/doc-sig/2010-April/003819.html

Re: [Numpy-discussion] Is this a small bug in numpydoc?

2010-04-14 Thread Pauli Virtanen
Wed, 14 Apr 2010 01:17:37 -0700, Fernando Perez wrote: [clip] Exception occurred: File /home/fperez/ipython/repo/trunk-lp/docs/sphinxext/numpydoc.py, line 71, in mangle_signature 'initializes x; see ' in pydoc.getdoc(obj.__init__)): AttributeError: class Bunch has no attribute

Re: [Numpy-discussion] rc2 for NumPy 1.4.1 and Scipy 0.7.2

2010-04-14 Thread Francesc Alted
A Sunday 11 April 2010 11:09:53 Ralf Gommers escrigué: Hi, I am pleased to announce the second release candidate of both Scipy 0.7.2 and NumPy 1.4.1, please test them. The issues reported with rc1 should be fixed, and for NumPy there are now Python 2.5 binaries as well. For SciPy there

Re: [Numpy-discussion] binomial coefficient, factorial

2010-04-14 Thread Alan G Isaac
On 4/13/2010 11:16 PM, jah wrote: binomial coefficent and factorial function http://code.google.com/p/econpy/source/browse/trunk/pytrix/pytrix.py fwiw, Alan Isaac ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] rc2 for NumPy 1.4.1 and Scipy 0.7.2

2010-04-14 Thread Charles R Harris
On Wed, Apr 14, 2010 at 7:08 AM, Francesc Alted fal...@pytables.org wrote: A Sunday 11 April 2010 11:09:53 Ralf Gommers escrigué: Hi, I am pleased to announce the second release candidate of both Scipy 0.7.2 and NumPy 1.4.1, please test them. The issues reported with rc1 should be

Re: [Numpy-discussion] rc2 for NumPy 1.4.1 and Scipy 0.7.2

2010-04-14 Thread Francesc Alted
A Wednesday 14 April 2010 15:36:00 Charles R Harris escrigué: /home/faltet/PyTables/pytables/trunk/tables/table.py:38: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility I'm using current stable Cython 12.1. Is the warning above intended or I'm doing something

[Numpy-discussion] How to combine a pair of 1D arrays?

2010-04-14 Thread Peter Shinners
Is there a way to combine two 1D arrays with the same size into a 2D array? It seems like the internal pointers and strides could be combined. My primary goal is to not make any copies of the data. It might be doable with a bit of ctypes if there is not a native numpy call. import numpy as

Re: [Numpy-discussion] How to combine a pair of 1D arrays?

2010-04-14 Thread Robert Kern
On Wed, Apr 14, 2010 at 10:25, Peter Shinners p...@shinners.org wrote: Is there a way to combine two 1D arrays with the same size into a 2D array? It seems like the internal pointers and strides could be combined. My primary goal is to not make any copies of the data. There is absolutely no

[Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Nikolaus Rath
Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [ [1,8,2], [2,1,3] ] magic_function(a, 2) == [ (0,1), (1,2) ] Since the largest 2 elements are at positions (0,1) and (1,2). Best, -Niko -- »Time flies like an arrow, fruit flies like a

[Numpy-discussion] Release candidate 2 for NumPy 1.4.1 and SciPy 0.7.2

2010-04-14 Thread Ralf Gommers
Hi, I am pleased to announce the second release candidate of both Scipy 0.7.2 and NumPy 1.4.1. Please test, and report any problems on the NumPy or SciPy list. I also want to specifically ask you to report success/failure with other libraries (Matplotlib, Pygame, your favorite lib here) based on

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Skipper Seabold
On Wed, Apr 14, 2010 at 11:16 AM, Nikolaus Rath nikol...@rath.org wrote: Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [ [1,8,2], [2,1,3] ] magic_function(a, 2) == [ (0,1), (1,2) ] Since the largest 2 elements are at positions (0,1) and

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Keith Goodman
On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath nikol...@rath.org wrote: Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [ [1,8,2], [2,1,3] ] magic_function(a, 2) == [ (0,1), (1,2) ] Since the largest 2 elements are at positions (0,1) and

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Gökhan Sever
On Wed, Apr 14, 2010 at 10:16 AM, Nikolaus Rath nikol...@rath.org wrote: Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [ [1,8,2], [2,1,3] ] magic_function(a, 2) == [ (0,1), (1,2) ] Since the largest 2 elements are at positions (0,1) and

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Keith Goodman
On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath nikol...@rath.org wrote: Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [ [1,8,2], [2,1,3] ] magic_function(a, 2) == [

Re: [Numpy-discussion] Is this a small bug in numpydoc?

2010-04-14 Thread Fernando Perez
On Wed, Apr 14, 2010 at 3:21 AM, Pauli Virtanen pav...@iki.fi wrote: But I didn't write numpydoc and I'm tired, so I don't want to commit this without a second pair of eyes... Yeah, it's a bug, I think. Thanks, fixed in r8333. Cheers, f ___

Re: [Numpy-discussion] How to combine a pair of 1D arrays?

2010-04-14 Thread Zachary Pincus
On Wed, Apr 14, 2010 at 10:25, Peter Shinners p...@shinners.org wrote: Is there a way to combine two 1D arrays with the same size into a 2D array? It seems like the internal pointers and strides could be combined. My primary goal is to not make any copies of the data. There is absolutely

Re: [Numpy-discussion] How to combine a pair of 1D arrays?

2010-04-14 Thread Anne Archibald
On 14 April 2010 11:34, Robert Kern robert.k...@gmail.com wrote: On Wed, Apr 14, 2010 at 10:25, Peter Shinners p...@shinners.org wrote: Is there a way to combine two 1D arrays with the same size into a 2D array? It seems like the internal pointers and strides could be combined. My primary goal

Re: [Numpy-discussion] rc2 for NumPy 1.4.1 and Scipy 0.7.2

2010-04-14 Thread Charles سمير Doutriaux
Just downloaded this. On my mac 10.6, using python 2.6.5 i get: Running from numpy source directory. non-existing path in 'numpy/distutils': 'site.cfg' F2PY Version 2 blas_opt_info: FOUND: extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'] define_macros = [('NO_ATLAS_INFO', 3)]

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Nikolaus Rath
Keith Goodman kwgood...@gmail.com writes: On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath nikol...@rath.org wrote: Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Keith Goodman
On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath nikol...@rath.org wrote: Keith Goodman kwgood...@gmail.com writes: On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:16 AM, Nikolaus Rath nikol...@rath.org wrote: Hello, How do I best find out

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Keith Goodman
On Wed, Apr 14, 2010 at 1:56 PM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath nikol...@rath.org wrote: Keith Goodman kwgood...@gmail.com writes: On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:16

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread eat
Nikolaus Rath Nikolaus at rath.org writes: Hello, How do I best find out the indices of the largest x elements in an array? Example: a = [ [1,8,2], [2,1,3] ] magic_function(a, 2) == [ (0,1), (1,2) ] Since the largest 2 elements are at positions (0,1) and (1,2). Best,

Re: [Numpy-discussion] binomial coefficient, factorial

2010-04-14 Thread Christopher Barker
jah wrote: Is there any chance that a binomial coefficent and factorial function can make their way into NumPy? probably not -- numpy is over-populated already I know these exist in Scipy, but I don't want to have to install SciPy just to have something so basic. The problem is that

Re: [Numpy-discussion] Proposal for new ufunc functionality

2010-04-14 Thread Stephen Simmons
I would really like to see this become a core part of numpy... For groupby-like summing over arrays, I use a modified version of numpy.bincount() which has optional arguments that greatly enhance its flexibility: bincount(bin, weights=, max_bins=. out=) where: * bins- numpy array

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Anne Archibald
On 14 April 2010 16:56, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath nikol...@rath.org wrote: Keith Goodman kwgood...@gmail.com writes: On Wed, Apr 14, 2010 at 8:49 AM, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 8:16 AM,

Re: [Numpy-discussion] binomial coefficient, factorial

2010-04-14 Thread Anne Archibald
On 14 April 2010 17:37, Christopher Barker chris.bar...@noaa.gov wrote: jah wrote: Is there any chance that a binomial coefficent and factorial function can make their way into NumPy? probably not -- numpy is over-populated already I know these exist in Scipy, but I don't want to have to

Re: [Numpy-discussion] Find indices of largest elements

2010-04-14 Thread Keith Goodman
On Wed, Apr 14, 2010 at 3:12 PM, Anne Archibald peridot.face...@gmail.com wrote: On 14 April 2010 16:56, Keith Goodman kwgood...@gmail.com wrote: On Wed, Apr 14, 2010 at 12:39 PM, Nikolaus Rath nikol...@rath.org wrote: Keith Goodman kwgood...@gmail.com writes: On Wed, Apr 14, 2010 at 8:49 AM,

Re: [Numpy-discussion] binomial coefficient, factorial

2010-04-14 Thread Christopher Barker
Anne Archibald wrote: The problem is that everyone has a different basic. What we really need is an easier way for folks to use sub-packages of scipy. I've found myself hand-extracting just what I need, too. Maybe I've been spoiled by using Linux, but my answer to this sort of thing is

Re: [Numpy-discussion] rc2 for NumPy 1.4.1 and Scipy 0.7.2

2010-04-14 Thread Ralf Gommers
2010/4/15 Charles سمير Doutriaux doutria...@llnl.gov Just downloaded this. On my mac 10.6, using python 2.6.5 i get: Which download, what build command and what python/gcc versions? Looks like you're trying to build a 64-bit binary without passing in -arch x86_64 flags? Ralf Running

Re: [Numpy-discussion] Math Library

2010-04-14 Thread James Bergstra
On Tue, Apr 6, 2010 at 10:08 AM, David Cournapeau wrote: could be put out of multiarray proper. Also, exposing an API for things like fancy indexing would be very useful, but I don't know if it even makes sense - I think a pure python implementation of fancy indexing as a reference would be