[Numpy-discussion] Python plugins for gcc static analysis

2011-06-22 Thread Charles R Harris
Thought gcc-python-pluginmight be of interest to some. One of the motivations seems to have been checking reference handling in cpython. Chuck ___ NumPy-Discussion mailing list NumPy-Discussion@scip

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Mark Wiebe
On Wed, Jun 22, 2011 at 4:57 PM, Darren Dale wrote: > On Wed, Jun 22, 2011 at 1:31 PM, Mark Wiebe wrote: > > On Wed, Jun 22, 2011 at 7:34 AM, Lluís wrote: > >> > >> Darren Dale writes: > >> > >> > On Tue, Jun 21, 2011 at 1:57 PM, Mark Wiebe > wrote: > >> >> On Tue, Jun 21, 2011 at 12:36 PM, Ch

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Darren Dale
On Wed, Jun 22, 2011 at 1:31 PM, Mark Wiebe wrote: > On Wed, Jun 22, 2011 at 7:34 AM, Lluís wrote: >> >> Darren Dale writes: >> >> > On Tue, Jun 21, 2011 at 1:57 PM, Mark Wiebe wrote: >> >> On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris >> >> wrote: >> >>> How does the ufunc get called so i

Re: [Numpy-discussion] argmax for top N elements

2011-06-22 Thread Keith Goodman
On Wed, Jun 22, 2011 at 12:08 PM, RadimRehurek wrote: >> Date: Wed, 22 Jun 2011 11:30:47 -0400 >> From: Alex Flint >> Subject: [Numpy-discussion] argmax for top N elements >> >> Is it possible to use argmax or something similar to find the locations of >> the largest N elements in a matrix? > > I

Re: [Numpy-discussion] argmax for top N elements

2011-06-22 Thread Olivier Grisel
2011/6/22 RadimRehurek : >> Date: Wed, 22 Jun 2011 11:30:47 -0400 >> From: Alex Flint >> Subject: [Numpy-discussion] argmax for top N elements >> >> Is it possible to use argmax or something similar to find the locations of >> the largest N elements in a matrix? > > I would also be interested in a

Re: [Numpy-discussion] argmax for top N elements

2011-06-22 Thread Benjamin Root
On Wed, Jun 22, 2011 at 2:08 PM, RadimRehurek wrote: > > Date: Wed, 22 Jun 2011 11:30:47 -0400 > > From: Alex Flint > > Subject: [Numpy-discussion] argmax for top N elements > > > > Is it possible to use argmax or something similar to find the locations > of > > the largest N elements in a matrix

Re: [Numpy-discussion] argmax for top N elements

2011-06-22 Thread RadimRehurek
> Date: Wed, 22 Jun 2011 11:30:47 -0400 > From: Alex Flint > Subject: [Numpy-discussion] argmax for top N elements > > Is it possible to use argmax or something similar to find the locations of > the largest N elements in a matrix? I would also be interested in an O(N) argmax/argmin for indices

Re: [Numpy-discussion] write access through iterator

2011-06-22 Thread Mark Wiebe
You can do something pretty close to that with the 1.6 iterator: >>> u = np.arange(20).reshape(5,4)[:,:3] >>> u array([[ 0, 1, 2], [ 4, 5, 6], [ 8, 9, 10], [12, 13, 14], [16, 17, 18]]) >>> for item in np.nditer(u, [], ['readwrite'], order='C'): ... item[...] =

[Numpy-discussion] write access through iterator

2011-06-22 Thread Neal Becker
Maybe I'm being dense today, but I don't see how to iterate over arrays with write access. You could read through iterators like: fl = u.flat >>> for item in fl: ... print item but you can't do for item in fl: item = 10 (or, it won't do what you want). Is there any way to do this? ___

Re: [Numpy-discussion] struct dtype cleanup for testing and review

2011-06-22 Thread Mark Wiebe
On Wed, Jun 22, 2011 at 12:49 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Wed, Jun 22, 2011 at 11:21 AM, Mark Wiebe wrote: > >> This set of patches cleans up struct dtypes quite a bit and generalizes >> them to allow overlapping and out-of-order fields with non-object dtypes

Re: [Numpy-discussion] struct dtype cleanup for testing and review

2011-06-22 Thread Charles R Harris
On Wed, Jun 22, 2011 at 11:21 AM, Mark Wiebe wrote: > This set of patches cleans up struct dtypes quite a bit and generalizes > them to allow overlapping and out-of-order fields with non-object dtypes. > The pull request is here: > > Overlapping, as in unions? > https://github.com/numpy/numpy/p

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Mark Wiebe
On Wed, Jun 22, 2011 at 7:34 AM, Lluís wrote: > Darren Dale writes: > > > On Tue, Jun 21, 2011 at 1:57 PM, Mark Wiebe wrote: > >> On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris > >> wrote: > >>> How does the ufunc get called so it doesn't get caught in an endless > loop? > > > [...] > > >>

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Mark Wiebe
On Wed, Jun 22, 2011 at 5:08 AM, Pauli Virtanen wrote: > Tue, 21 Jun 2011 16:43:13 -0500, Mark Wiebe wrote: > [clip: __array_wrap__] > > Those could stay as they are, and just the ufunc usage of __array_wrap__ > > can be deprecated. For classes which currently use __array_wrap__, they > > would j

[Numpy-discussion] struct dtype cleanup for testing and review

2011-06-22 Thread Mark Wiebe
This set of patches cleans up struct dtypes quite a bit and generalizes them to allow overlapping and out-of-order fields with non-object dtypes. The pull request is here: https://github.com/numpy/numpy/pull/94 The commit with documentation changes is here: https://github.com/m-paradox/numpy/com

Re: [Numpy-discussion] argmax for top N elements

2011-06-22 Thread eat
Hi, On Wed, Jun 22, 2011 at 6:30 PM, Alex Flint wrote: > Is it possible to use argmax or something similar to find the locations of > the largest N elements in a matrix? How bout argsort(.)?, Like: In []: a= arange(9) In []: a.argsort()[::-1][:3] Out[]: array([8, 7, 6]) My 2 cents, eat > ___

[Numpy-discussion] argmax for top N elements

2011-06-22 Thread Alex Flint
Is it possible to use argmax or something similar to find the locations of the largest N elements in a matrix? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] review/test pull request for tightening default ufunc casting rule

2011-06-22 Thread Mark Wiebe
Pull request is here: https://github.com/numpy/numpy/pull/95 -Mark ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] datetime pull request for review and build/test

2011-06-22 Thread Mark Wiebe
This has been reviewed, I'm proceeding with a merge. -Mark On Mon, Jun 20, 2011 at 7:38 PM, Mark Wiebe wrote: > https://github.com/numpy/numpy/pull/93 > > The summary: > > * Tighten up date unit vs time unit casting rules, and integrate the > NPY_CASTING enum deeper into the datetime conversion

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Lluís
Darren Dale writes: > On Tue, Jun 21, 2011 at 1:57 PM, Mark Wiebe wrote: >> On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris >> wrote: >>> How does the ufunc get called so it doesn't get caught in an endless loop? > [...] >> The function being called needs to ensure this, either by extractin

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Darren Dale
On Tue, Jun 21, 2011 at 1:57 PM, Mark Wiebe wrote: > On Tue, Jun 21, 2011 at 12:36 PM, Charles R Harris > wrote: >> How does the ufunc get called so it doesn't get caught in an endless loop? [...] > The function being called needs to ensure this, either by extracting a raw > ndarray from instan

Re: [Numpy-discussion] replacing the mechanism for dispatching ufuncs

2011-06-22 Thread Pauli Virtanen
Tue, 21 Jun 2011 16:43:13 -0500, Mark Wiebe wrote: [clip: __array_wrap__] > Those could stay as they are, and just the ufunc usage of __array_wrap__ > can be deprecated. For classes which currently use __array_wrap__, they > would just need to also implement _numpy_ufunc_ to eliminate any > depreca

Re: [Numpy-discussion] what python module to handle csv?

2011-06-22 Thread Chao YUE
Thank you Olivier and Abie, I'll try that~~ Best wishes, Chao 2011/6/21 A. Flaxman > I am a huge fan of rec2csv and csv2rec, which might not technically be > part of numpy, and can be found in pylab or the matplotlib.mlab module.*** > * > > ** ** > > --Abie > > ** ** > > ** ** > > *From:*