Re: [Numpy-discussion] Should ndarray subclasses support the keepdims arg?

2015-05-05 Thread Neil Girdhar
Maybe they should have written their code with **kwargs that consumes all keyword arguments rather than assuming that no keyword arguments would be added? The problem with this approach in general is that it makes writing code unnecessarily convoluted. On Tue, May 5, 2015 at 1:55 PM, Nathaniel Sm

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-29 Thread Neil Girdhar
ementation to make it fast. What I want is for that conversion to be automated. I'm still evaluating how to best achieve that. On Tue, Apr 28, 2015 at 6:08 AM, Francesc Alted wrote: > 2015-04-28 4:59 GMT+02:00 Neil Girdhar : > >> I don't think I'm asking for so much.

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-27 Thread Neil Girdhar
bits of numexpr that I like with my code. For my purpose, this would have been the more ideal design. On Mon, Apr 27, 2015 at 10:47 PM, Nathaniel Smith wrote: > On Apr 27, 2015 5:30 PM, "Neil Girdhar" wrote: > > > > > > > > On Mon, Apr 27, 2015 at 7:42 PM, Na

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-27 Thread Neil Girdhar
Wow, cool! Are there any users of this package? On Mon, Apr 27, 2015 at 9:07 PM, Alexander Belopolsky wrote: > > On Mon, Apr 27, 2015 at 7:14 PM, Nathaniel Smith wrote: > >> There's no way to access the ast reliably at runtime in python -- it gets >> thrown away during compilation. > > > The "

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-27 Thread Neil Girdhar
On Mon, Apr 27, 2015 at 7:42 PM, Nathaniel Smith wrote: > On Mon, Apr 27, 2015 at 4:23 PM, Neil Girdhar > wrote: > > I was told that numba did similar ast parsing, but maybe that's not true. > > Regarding the ast, I don't know about reliability, but take a look

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-27 Thread Neil Girdhar
Also, FYI: http://numba.pydata.org/numba-doc/0.6/doc/modules/transforms.html It appears that numba does get the ast similar to pyautodiff and only get the ast from source code as a fallback? On Mon, Apr 27, 2015 at 7:23 PM, Neil Girdhar wrote: > I was told that numba did similar ast pars

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-27 Thread Neil Girdhar
2015 at 7:14 PM, Nathaniel Smith wrote: > On Apr 27, 2015 1:44 PM, "Neil Girdhar" wrote: > > > > I've always wondered why numexpr accepts strings rather than looking a > function's source code, using ast to parse it, and then transforming the > AST. I just

Re: [Numpy-discussion] ANN: numexpr 2.4.3 released

2015-04-27 Thread Neil Girdhar
I've always wondered why numexpr accepts strings rather than looking a function's source code, using ast to parse it, and then transforming the AST. I just looked at another project, pyautodiff, which does that. And I think numba does that for llvm code generation. Wouldn't it be nicer to just a

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-17 Thread Neil Girdhar
On Fri, Apr 17, 2015 at 12:09 PM, wrote: > On Fri, Apr 17, 2015 at 11:22 AM, Neil Girdhar > wrote: > > > > > > On Fri, Apr 17, 2015 at 10:47 AM, wrote: > >> > >> On Fri, Apr 17, 2015 at 10:07 AM, Sebastian Berg > >> wrote: > >

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-17 Thread Neil Girdhar
On Fri, Apr 17, 2015 at 12:09 PM, wrote: > On Fri, Apr 17, 2015 at 11:22 AM, Neil Girdhar > wrote: > > > > > > On Fri, Apr 17, 2015 at 10:47 AM, wrote: > >> > >> On Fri, Apr 17, 2015 at 10:07 AM, Sebastian Berg > >> wrote: > >

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-17 Thread Neil Girdhar
This relationship between outer an dot only holds for vectors. For tensors, and other kinds of vector spaces, I'm not sure if outer products and dot products have anything to do with each other. On Fri, Apr 17, 2015 at 11:11 AM, wrote: > On Fri, Apr 17, 2015 at 10:59 AM, Sebastian Berg > wrote

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-17 Thread Neil Girdhar
On Fri, Apr 17, 2015 at 10:47 AM, wrote: > On Fri, Apr 17, 2015 at 10:07 AM, Sebastian Berg > wrote: > > On Do, 2015-04-16 at 15:28 -0700, Matthew Brett wrote: > >> Hi, > >> > > > >> > >> So, how about a slight modification of your proposal? > >> > >> 1) Raise deprecation warning for np.outer f

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-16 Thread Neil Girdhar
Right. On Thu, Apr 16, 2015 at 6:44 PM, Nathaniel Smith wrote: > On Thu, Apr 16, 2015 at 6:37 PM, Neil Girdhar > wrote: > > I can always put np.outer = np.multiply.outer at the start of my code to > get > > what I want. Or could that break things? > > Please don

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-16 Thread Neil Girdhar
On Thu, Apr 16, 2015 at 6:32 PM, Nathaniel Smith wrote: > On Thu, Apr 16, 2015 at 6:19 PM, Neil Girdhar > wrote: > > Actually, looking at the docs, numpy.outer is *only* defined for 1-d > > vectors. Should anyone who used it with multi-dimensional arrays have an > >

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-16 Thread Neil Girdhar
That sounds good to me. I can always put np.outer = np.multiply.outer at the start of my code to get what I want. Or could that break things? On Thu, Apr 16, 2015 at 6:28 PM, Matthew Brett wrote: > Hi, > > On Thu, Apr 16, 2015 at 3:19 PM, Neil Girdhar > wrote: > > Actual

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-16 Thread Neil Girdhar
Actually, looking at the docs, numpy.outer is *only* defined for 1-d vectors. Should anyone who used it with multi-dimensional arrays have an expectation that it will keep working in the same way? On Thu, Apr 16, 2015 at 10:53 AM, Neil Girdhar wrote: > Would it be possible to deprec

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-16 Thread Neil Girdhar
On Wed, Apr 15, 2015 at 6:08 PM, wrote: > >> On Wed, Apr 15, 2015 at 5:31 PM, Neil Girdhar > wrote: > >>> Does it work for you to set > >>> > >>> outer = np.multiply.outer > >>> > >>> ? > >>> > >>> It&#x

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-15 Thread Neil Girdhar
Fernández del Río < jaime.f...@gmail.com> wrote: > On Wed, Apr 15, 2015 at 8:06 AM, Neil Girdhar > wrote: > >> You got it. I remember this from when I worked at Google and we would >> process (many many) logs. With enough bins, the approximation is still >> really

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-15 Thread Neil Girdhar
I don't understand. Are you at pycon by any chance? On Wed, Apr 15, 2015 at 6:12 PM, wrote: > On Wed, Apr 15, 2015 at 6:08 PM, wrote: > > On Wed, Apr 15, 2015 at 5:31 PM, Neil Girdhar > wrote: > >> Does it work for you to set > >> > >> outer =

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-15 Thread Neil Girdhar
Does it work for you to set outer = np.multiply.outer ? It's actually faster on my machine. On Wed, Apr 15, 2015 at 5:29 PM, wrote: > On Wed, Apr 15, 2015 at 7:35 AM, Neil Girdhar > wrote: > > Yes, I totally agree. If I get started on the PR to deprecate np.outer, > &g

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-15 Thread Neil Girdhar
ith n=100 bins. I don't think it does O(n) computations per point. I think it's more like O(log(n)). Best, Neil On Wed, Apr 15, 2015 at 10:02 AM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > On Wed, Apr 15, 2015 at 4:36 AM, Neil Girdhar > wrote: > >

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-15 Thread Neil Girdhar
Yeah, I'm not arguing, I'm just curious about your reasoning. That explains why not C++. Why would you want to do this in C and not Python? On Wed, Apr 15, 2015 at 1:48 AM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > On Tue, Apr 14, 2015 at 6:16 PM, Neil Girdha

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-15 Thread Neil Girdhar
22:18 -0400, Nathaniel Smith wrote: > > I am, yes. > > > > On Apr 14, 2015 9:17 PM, "Neil Girdhar" wrote: > > Ok, I didn't know that. Are you at pycon by any chance? > > > > On Tue, Apr 14, 2015 at 7:16 PM, Nathaniel Smith > >

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-14 Thread Neil Girdhar
PM, Jaime Fernández del Río < > jaime.f...@gmail.com> wrote: > >> On Tue, Apr 14, 2015 at 4:12 PM, Nathaniel Smith wrote: >> >>> On Mon, Apr 13, 2015 at 8:02 AM, Neil Girdhar >>> wrote: >>> > Can I suggest that we instead add the P-squar

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-14 Thread Neil Girdhar
Ok, I didn't know that. Are you at pycon by any chance? On Tue, Apr 14, 2015 at 7:16 PM, Nathaniel Smith wrote: > On Tue, Apr 14, 2015 at 3:48 PM, Neil Girdhar > wrote: > > Yes, I totally agree with you regarding np.sum and np.product, which is > why > > I di

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-14 Thread Neil Girdhar
t; >> On Mon, Apr 13, 2015 at 8:02 AM, Neil Girdhar >> wrote: >> > Can I suggest that we instead add the P-square algorithm for the dynamic >> > calculation of histograms? >> > ( >> http://pierrechainais.ec-lille.fr/Centrale/Option_DAD/IMPACT_fil

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-14 Thread Neil Girdhar
Yes, you're right. Although in practice, people almost always want adaptive bins. On Tue, Apr 14, 2015 at 5:08 PM, Chris Barker wrote: > On Mon, Apr 13, 2015 at 5:02 AM, Neil Girdhar > wrote: > >> Can I suggest that we instead add the P-square algorithm for the dynam

Re: [Numpy-discussion] Automatic number of bins for numpy histograms

2015-04-14 Thread Neil Girdhar
Can I suggest that we instead add the P-square algorithm for the dynamic calculation of histograms? ( http://pierrechainais.ec-lille.fr/Centrale/Option_DAD/IMPACT_files/Dynamic%20quantiles%20calcultation%20-%20P2%20Algorythm.pdf ) This is already implemented in C++'s boost library ( http://www.bo

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-14 Thread Neil Girdhar
Apr 14, 2015 2:48 PM, "Neil Girdhar" wrote: > > > > Okay, but by the same token, why do we have cumsum? Isn't it identical > to > > > > np.add.accumulate > > > > — or if you're passing in multidimensional data — > > > > np.ad

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-14 Thread Neil Girdhar
ocumenting. Similarly, cumprod is just np.multiply.accumulate. Best, Neil On Sat, Apr 11, 2015 at 12:49 PM, Nathaniel Smith wrote: > Documentation and a call to warnings.warn(DeprecationWarning(...)), I > guess. > > On Sat, Apr 11, 2015 at 12:39 PM, Neil Girdhar > wrote: > > I

Re: [Numpy-discussion] Consider improving numpy.outer's behavior with zero-dimensional vectors

2015-04-14 Thread Neil Girdhar
run took 25.59 times longer than the fastest. This could mean that an intermediate result is being cached 100 loops, best of 3: 834 ns per loop On Tue, Apr 14, 2015 at 7:42 AM, Neil Girdhar wrote: > Okay, but by the same token, why do we have cumsum? Isn't it iden

[Numpy-discussion] Bug in 1.9?

2014-10-22 Thread Neil Girdhar
Hello, Is this desired behaviour or a regression or a bug? http://stackoverflow.com/questions/26497656/how-do-i-align-a-numpy-record-array-recarray Thanks, Neil ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman

Re: [Numpy-discussion] Code review request: PrintOptions

2013-10-27 Thread Neil Girdhar
Is this what I want? https://github.com/numpy/numpy/pull/3987 On Sun, Oct 27, 2013 at 9:42 PM, Neil Girdhar wrote: > Yeah, I realized that I missed that and figured it wouldn't matter since > it was my own master and I don't plan on making other changes to numpy. If > you

Re: [Numpy-discussion] Code review request: PrintOptions

2013-10-27 Thread Neil Girdhar
, Oct 27, 2013 at 9:38 PM, Charles R Harris wrote: > > > > On Sun, Oct 27, 2013 at 7:23 PM, Neil Girdhar wrote: > >> This is my first code review request, so I may have done some things >> wrong. I think the following URL should work? >> https://github.com/MisterShe

[Numpy-discussion] Code review request: PrintOptions

2013-10-27 Thread Neil Girdhar
This is my first code review request, so I may have done some things wrong. I think the following URL should work? https://github.com/MisterSheik/numpy/compare Best, Neil ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.or

Re: [Numpy-discussion] Testing

2013-10-27 Thread Neil Girdhar
Since I am trying to add a "printoptions" context manager, I would like to test it. Should I add tests, or can I somehow use it from an ipython shell? On Sun, Oct 27, 2013 at 7:12 PM, Charles R Harris wrote: > > > > On Sun, Oct 27, 2013 at 4:59 PM, Neil Girdhar wrote

Re: [Numpy-discussion] Testing

2013-10-27 Thread Neil Girdhar
Ah, sorry, didn't see that I can do that from runtests!! Thanks!! On Sun, Oct 27, 2013 at 7:13 PM, Neil Girdhar wrote: > Since I am trying to add a "printoptions" context manager, I would like to > test it. Should I add tests, or can I somehow use it from an ipython she

[Numpy-discussion] Testing

2013-10-27 Thread Neil Girdhar
How do I test a patch that I've made locally? I can't seem to import numpy locally: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python intepreter from there. _

[Numpy-discussion] A context manager for print options

2013-10-27 Thread Neil Girdhar
Why not replace get_printoptions/set_printoptions with a context manager accessed using numpy.printoptions in the same way that numpy.errstate exposes a context manager to seterr/geterr? This would make the set method redundant. Also, the context manager returned by numpy.errstate, numpy.printopt