Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Charles R Harris
On Wed, Jun 5, 2013 at 12:00 PM, Charles R Harris wrote: > > > On Wed, Jun 5, 2013 at 11:59 AM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Wed, Jun 5, 2013 at 11:48 AM, Nathaniel Smith wrote: >> >>> On Wed, Jun 5, 2013 at 6:08 PM, Julian Taylor >>> wrote: >>> > On 05.0

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Charles R Harris
On Wed, Jun 5, 2013 at 11:59 AM, Charles R Harris wrote: > > > On Wed, Jun 5, 2013 at 11:48 AM, Nathaniel Smith wrote: > >> On Wed, Jun 5, 2013 at 6:08 PM, Julian Taylor >> wrote: >> > On 05.06.2013 16:33, Nathaniel Smith wrote: >> >> The slow down people are worried about is, suppose that 'xp'

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Charles R Harris
On Wed, Jun 5, 2013 at 11:48 AM, Nathaniel Smith wrote: > On Wed, Jun 5, 2013 at 6:08 PM, Julian Taylor > wrote: > > On 05.06.2013 16:33, Nathaniel Smith wrote: > >> The slow down people are worried about is, suppose that 'xp' has > >> 1,000,000 entries, and the user wants to interpolate 1 point

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Nathaniel Smith
On Wed, Jun 5, 2013 at 6:08 PM, Julian Taylor wrote: > On 05.06.2013 16:33, Nathaniel Smith wrote: >> The slow down people are worried about is, suppose that 'xp' has >> 1,000,000 entries, and the user wants to interpolate 1 point. If we >> can assume the array is sorted, then we can find which bi

Re: [Numpy-discussion] supporting quad precision

2013-06-05 Thread David Cournapeau
On Wed, Jun 5, 2013 at 5:21 PM, Charles R Harris wrote: > Hi Anne, > > Long time no see ;) > > On Wed, Jun 5, 2013 at 10:07 AM, Anne Archibald wrote: >> >> Hi folks, >> >> I recently came across an application I needed quad precision for >> (high-accuracy solution of a differential equation). I f

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Julian Taylor
On 05.06.2013 16:33, Nathaniel Smith wrote: > On Wed, Jun 5, 2013 at 3:16 PM, Slavin, Jonathan > wrote: >> The simplest monotonicity test that I've seen is: >> >> dx = np.diff(x) >> monotonic = np.all(dx < 0.) or np.all(dx > 0.) >> >> I expect that this is pretty fast, though I haven't tested it y

[Numpy-discussion] genfromtxt and gzip

2013-06-05 Thread Ted To
Hi all, >From the list archives (2011), I noticed that there is a bug in the python gzip module that causes genfromtxt to fail with python 2 but this bug is not a problem for python 3. When I tried to use genfromtxt and python 3 with a gzip'ed csv file, I instead got: IOError: Mode rbU not suppo

Re: [Numpy-discussion] supporting quad precision

2013-06-05 Thread Charles R Harris
Hi Anne, Long time no see ;) On Wed, Jun 5, 2013 at 10:07 AM, Anne Archibald wrote: > Hi folks, > > I recently came across an application I needed quad precision for > (high-accuracy solution of a differential equation). I found a C++ library > (odeint) that worked for the integration itself, b

[Numpy-discussion] supporting quad precision

2013-06-05 Thread Anne Archibald
Hi folks, I recently came across an application I needed quad precision for (high-accuracy solution of a differential equation). I found a C++ library (odeint) that worked for the integration itself, but unfortunately it appears numpy is not able to work with quad precision arrays. For my applicat

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Nathaniel Smith
On Wed, Jun 5, 2013 at 3:16 PM, Slavin, Jonathan wrote: > The simplest monotonicity test that I've seen is: > > dx = np.diff(x) > monotonic = np.all(dx < 0.) or np.all(dx > 0.) > > I expect that this is pretty fast, though I haven't tested it yet. If we > want to make checking optional, then I th

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Slavin, Jonathan
The simplest monotonicity test that I've seen is: dx = np.diff(x) monotonic = np.all(dx < 0.) or np.all(dx > 0.) I expect that this is pretty fast, though I haven't tested it yet. If we want to make checking optional, then I think the default should be to check with the option to skip the check.

Re: [Numpy-discussion] suggested change of behavior for interp

2013-06-05 Thread Nathaniel Smith
On 5 Jun 2013 03:21, "Eric Firing" wrote: > > On 2013/06/04 4:15 PM, Benjamin Root wrote: > > Could non-monotonicity be detected as part of the interp process? > > Perhaps a sign switch in the deltas? > > There are two code paths, depending on the number of points to be > interpolated. When it is