numexpr icon indicating copy to clipboard operation
numexpr copied to clipboard

numexpr.evaluate('0', out=A) fails

Open albop opened this issue 10 years ago • 1 comments

Currently, the instructions

import numpy
import numexpr
a = numpy.zeros((2,2))
numexpr.evaluate('0.0', out=a)```

fail with error ValueError: output for a constant expression must have size 1

It would be nice to have regular broadcasting instead that would make it behave like:

import numpy
import numexpr
a = numpy.zeros((2,2))
K = numpy.array(0.0) 
numexpr.evaluate('K', out=a)```

That would be useful when evaluating user-supplied formulas, that may occasionally be constant expressions.

albop avatar May 09 '14 20:05 albop

Agreed. Feel free to contribute a patch if you want to.

FrancescAlted avatar Apr 14 '15 15:04 FrancescAlted

Message to comment on stale issues. If none provided, will not mark issues stale

github-actions[bot] avatar Feb 22 '24 01:02 github-actions[bot]