Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Ralf Gommers
On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington jking...@wisc.edu wrote: Is there a numpy function for testing floating point equality that returns a boolean array? I'm aware of np.allclose, but I need a boolean array. Properly handling NaN's and Inf's (as allclose does) would be a nice bonus.

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 13:59, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington jking...@wisc.edu wrote: Is there a numpy function for testing floating point equality that returns a boolean array? I'm aware of np.allclose, but I need a boolean

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Ralf Gommers
On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 13:59, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington jking...@wisc.edu wrote: Is there a numpy function for testing floating point equality

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 13:59, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Thu, Mar 1, 2012 at 11:44 PM, Joe Kington

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Benjamin Root
On Saturday, March 3, 2012, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 13:59, Ralf Gommers ralf.gomm...@googlemail.com

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 15:22, Benjamin Root ben.r...@ou.edu wrote: On Saturday, March 3, 2012, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com wrote: On Sat, Mar 3, 2012 at 3:05 PM, Robert Kern robert.k...@gmail.com wrote:

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 14:34, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com wrote: Because this is also bad: np.TAB Display all 561 possibilities? (y or n) Not as bad as overloading np.allclose(x,y,return_array=True). Or

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Olivier Delalleau
Le 3 mars 2012 10:27, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012 at 14:34, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com wrote: Because this is also bad: np.TAB Display all 561 possibilities? (y or

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau sh...@keba.be wrote: Le 3 mars 2012 10:27, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012 at 14:34, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com wrote:

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Olivier Delalleau
Le 3 mars 2012 11:03, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau sh...@keba.be wrote: Le 3 mars 2012 10:27, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012 at 14:34, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3,

[Numpy-discussion] C++ Example

2012-03-03 Thread Luis Pedro Coelho
Hi, I sort of missed the big C++ discussion, but I'd like to give some examples of how writing code can become much simpler if you are based on C++. This is from my mahotas package, which has a thin C++ wrapper around numpy's C API

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Robert Kern
On Sat, Mar 3, 2012 at 16:06, Olivier Delalleau sh...@keba.be wrote: Le 3 mars 2012 11:03, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau sh...@keba.be wrote: Le 3 mars 2012 10:27, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Joe Kington
On Sat, Mar 3, 2012 at 10:06 AM, Olivier Delalleau sh...@keba.be wrote: Le 3 mars 2012 11:03, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3, 2012 at 15:51, Olivier Delalleau sh...@keba.be wrote: Le 3 mars 2012 10:27, Robert Kern robert.k...@gmail.com a écrit : On Sat, Mar 3,

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Joe Kington
On Sat, Mar 3, 2012 at 9:26 AM, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 15:22, Benjamin Root ben.r...@ou.edu wrote: On Saturday, March 3, 2012, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 14:31, Ralf Gommers ralf.gomm...@googlemail.com

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Olivier Delalleau
Le 3 mars 2012 13:07, Joe Kington jking...@wisc.edu a écrit : On Sat, Mar 3, 2012 at 9:26 AM, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar 3, 2012 at 15:22, Benjamin Root ben.r...@ou.edu wrote: On Saturday, March 3, 2012, Robert Kern robert.k...@gmail.com wrote: On Sat, Mar

[Numpy-discussion] Missing data again

2012-03-03 Thread Travis Oliphant
Hi all, I've been thinking a lot about the masked array implementation lately. I finally had the time to look hard at what has been done and now am of the opinion that I do not think that 1.7 can be released with the current state of the masked array implementation *unless* it is clearly

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Charles R Harris
On Sat, Mar 3, 2012 at 1:30 PM, Travis Oliphant tra...@continuum.io wrote: Hi all, I've been thinking a lot about the masked array implementation lately. I finally had the time to look hard at what has been done and now am of the opinion that I do not think that 1.7 can be released with the

Re: [Numpy-discussion] Missing data again

2012-03-03 Thread Travis Oliphant
Mind, Mark only had a few weeks to write code. I think the unfinished state is a direct function of that. I have heard from several users that they will *not use the missing data* in NumPy as currently implemented, and I can now see why.For better or for worse, my approach to

Re: [Numpy-discussion] Floating point close function?

2012-03-03 Thread Joe Kington
On Sat, Mar 3, 2012 at 12:50 PM, Olivier Delalleau sh...@keba.be wrote: Would it be helpful if I went ahead and submitted a pull request with the function in my original question called isclose (along with a complete docstring and a few tests)? One note: At the moment, it deliberately

Re: [Numpy-discussion] C++ Example

2012-03-03 Thread David Cournapeau
On Sat, Mar 3, 2012 at 8:07 AM, Luis Pedro Coelho l...@cmu.edu wrote: Hi, I sort of missed the big C++ discussion, but I'd like to give some examples of how writing code can become much simpler if you are based on C++. This is from my mahotas package, which has a thin C++ wrapper around