Re: [Numpy-discussion] Dates and times and Datetime64 (again)

2014-03-18 Thread Chris Barker
On Tue, Mar 18, 2014 at 2:49 PM, Sankarshan Mudkavi wrote: > It's been a while since the last datetime and timezones discussion thread > was visited (linked below): > > http://thread.gmane.org/gmane.comp.python.numeric.general/53805 > > It looks like the best approach to follow is the UTC only app

Re: [Numpy-discussion] PR with changes to triangular array functions

2014-03-18 Thread Ralf Gommers
On Tue, Mar 18, 2014 at 11:21 PM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > I submitted a PR that makes some improvements to the numpy functions > dealing with triangular arrays. Aside from a general speed-up of about 2x > for most functions, there are some minor changes to the publ

[Numpy-discussion] PR with changes to triangular array functions

2014-03-18 Thread Jaime Fernández del Río
I submitted a PR that makes some improvements to the numpy functions dealing with triangular arrays. Aside from a general speed-up of about 2x for most functions, there are some minor changes to the public API. In case anyone is concerned about them, here's a list: * 'np.tri' now accepts a boolean

Re: [Numpy-discussion] [RFC] should we argue for a matrix power operator, @@?

2014-03-18 Thread Ondřej Čertík
On Mon, Mar 17, 2014 at 11:30 AM, Fernando Perez wrote: > On Mon, Mar 17, 2014 at 10:01 AM, Aron Ahmadia wrote: >> >> >> On Mon, Mar 17, 2014 at 7:53 AM, Nathaniel Smith wrote: >>> >>> The thread so far, it sounds like the consensus answer is "meh, >>> whatever". So I'm thinking we should just d

[Numpy-discussion] Dates and times and Datetime64 (again)

2014-03-18 Thread Sankarshan Mudkavi
Hey all, It's been a while since the last datetime and timezones discussion thread was visited (linked below): http://thread.gmane.org/gmane.comp.python.numeric.general/53805 It looks like the best approach to follow is the UTC only approach in the linked thread with an optional flag to indica

Re: [Numpy-discussion] _gufuncs_linalg module

2014-03-18 Thread Jay Bourque
Okay, it looks like the removal was part of this PR, and that PR is referenced from this issuewhich mentions needing more review and tests, and also lists several todo items and open issues. I think that more or l

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Christophe Bal
I'm not saying that Python choices are wrong, I'm just saying that if * is elementwise product, then (A*B)@C <> A*(B@C) should imply to choose different levels fro * and @. By choosing A*B@C = (A*B)@C, that is a convention, we just say that a human who want to calculate something like A*B@C*D@E@G*

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Christophe Bal
I think that there is very big misunderstanding. My point of view is both a mathematical and a programmagical one. Le 18 mars 2014 20:20, "Nathaniel Smith" a écrit : > On 18 Mar 2014 17:32, "Christophe Bal" wrote: > > > > This is a different situation because / is indeed an hidden > multiplicati

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Nathaniel Smith
On 18 Mar 2014 17:32, "Christophe Bal" wrote: > > This is a different situation because / is indeed an hidden multiplication : a/b = a*inv(b). The same is true for + and - : a-b=a+opp(b). What I'm saying is that these operations * and / are indeed of the very same j-kind. > > This is not the same

Re: [Numpy-discussion] _gufuncs_linalg module

2014-03-18 Thread Nathaniel Smith
On Tue, Mar 18, 2014 at 5:26 PM, Jay Bourque wrote: > I was just about to submit some pull requests for fixes to the > _gufuncs_linalg module and discovered that it no longer exists. It looks > like it was removed in this commit. Is there any reason why it was removed > without any apparent discus

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Christophe Bal
This is a different situation because / is indeed an hidden multiplication : a/b = a*inv(b). The same is true for + and - : a-b=a+opp(b). What I'm saying is that these operations * and / are indeed of the very same j-kind. This is not the same for * and @. 2014-03-18 17:53 GMT+01:00 Nathaniel Sm

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread josef . pktd
I'm still bothered by what Nathaniel mentioned about mixing 1d and 2d arrays >>> c = np.arange(4) >>> a = np.arange(16).reshape(4,4) >>> cc = c[:,None] >>> a.dot(c).dot(c.T) 420 >>> a.dot(c.dot(c.T)) array([[ 0, 14, 28, 42], [ 56, 70, 84, 98], [112, 126, 140, 154], [

[Numpy-discussion] _gufuncs_linalg module

2014-03-18 Thread Jay Bourque
I was just about to submit some pull requests for fixes to the _gufuncs_linalg module and discovered that it no longer exists. It looks like it was removed in this commit. Is there any reason why it was removed without

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Nathaniel Smith
On Tue, Mar 18, 2014 at 3:22 PM, Christophe Bal wrote: > About weak-left. You need to define a priority of @ the matrix product > regarding to * the elementwise product because (A*B)@C <> A*(B@C) This doesn't follow. (a / b) * c != a / (b * c), but / and * in Python have the same priority. --

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Nathaniel Smith
On Tue, Mar 18, 2014 at 9:50 AM, Eelco Hoogendoorn wrote: > To elaborate a little on such a more general and explicit method of > specifying linear operations (perhaps 'expressions with named axes' is a > good nomer to cover this topic). [...] This is a good topic to bring up on numpy-discussion,

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Christophe Bal
When I write "using mathematical like notations...", Matrix1 * Matrix2 is a matrix multiplication. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Christophe Bal
Strange, Gmail has cut my example. Here it is normally. *[1 2]* *A = [3 4]* *[5 6]* *B = [7 8]* *[a d]* *C = [b c]* *(A*B)@C* *=* *[5 12] [a d]* *[21 32] @ [b c]* *=* *[5a+12b 5d+12c ]* *[21a+32b 21d+32c]* *A*(B@C)* *=* *[1 2] [5a+6b 5d+6c]* *[3 4] * [7a+8b 7d+8c]* *=* *[5a+

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Robert Kern
On Tue, Mar 18, 2014 at 3:22 PM, Christophe Bal wrote: > About weak-left. You need to define a priority of @ the matrix product > regarding to * the elementwise product because (A*B)@C <> A*(B@C) : see the > example above. I say that also from a mathematical point of view. What example above? >

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Christophe Bal
*About weak-left.* You need to define a priority of @ the matrix product regarding to * the elementwise product because (A*B)@C <> A*(B@C) : see the example above. I say that also from a mathematical point of view. Using mathematical like notations, Matrix1 * Matrix2 * 3 can be written because (Ma

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Eelco Hoogendoorn
To elaborate a little on such a more general and explicit method of specifying linear operations (perhaps 'expressions with named axes' is a good nomer to cover this topic). I think indexing rather than calling is preferable. I worried at first about the performance overhead of checking for string

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Robert Kern
On Tue, Mar 18, 2014 at 12:54 AM, Nathaniel Smith wrote: > On Sat, Mar 15, 2014 at 6:28 PM, Nathaniel Smith wrote: >> Mathematica: instead of having an associativity, a @ b @ c gets >> converted into mdot([a, b, c]) > > So, I've been thinking about this (thanks to @rfateman for pointing it > out)

Re: [Numpy-discussion] [help needed] associativity and precedence of '@'

2014-03-18 Thread Sebastian Haase
Just add one vote: I am for * right association * because 1) I'm thinking of matrix multiplication more like operators, which I also learned to work from right to left and because 2) I would put a vector to the right, which would result in better performance. I don't have an opinion on tight/sam