numexpr
numexpr copied to clipboard
-sum(a) does not work
From [email protected] on March 19, 2012 15:03:51
import numexpr as ne
ne.evaluate('-sum(1)') ne.evaluate('-1_sum(1)') ne.evaluate('sum(1)_(-1)')
All of these fail with the following message.
RuntimeError: invalid program: reduction operations must occur last
This bug does not happen if 'sum' is replaced with 'abs', 'exp', or 'log', and presumably all the other ones.
This is on numexpr version 2.0.1.
Original issue: http://code.google.com/p/numexpr/issues/detail?id=76
From [email protected] on March 19, 2012 07:15:50
Looks like replacing 'sum' with 'prod' also reproduces the error message.
From [email protected] on March 19, 2012 09:31:26
Hmm, I just realized this behavior may be intended. I can't find documentation on it though.
From [email protected] on April 29, 2013 03:38:09
Yes, this is a known limitation. Now it is properly documented in a new note in: https://code.google.com/p/numexpr/wiki/UsersGuide?ts=1367231786&updated=UsersGuide#Supported_reduction_operations
Status: Accepted
Message to comment on stale issues. If none provided, will not mark issues stale