Closed GoogleCodeExporter closed 9 years ago
FWIW, you can do: ne.evaluate("(a + b)/2.", {'a': A[...,0:-1], 'b': A[...,1:]})
Original comment by gdemen...@gmail.com
on 27 Sep 2011 at 12:51
I agree that support for indexing would be very useful, especially since a
single cell can be evaluated to a boolean result. This would particularly
benefit the PyTable project, as mentioned in this PyTables issue:
https://github.com/PyTables/PyTables/issues/127#issuecomment-3803520
Original comment by aaronqui...@gmail.com
on 3 Feb 2012 at 8:34
concur
in my case (and I am not yet a user of numexpr -- just came around it while
contributing to its package maintenance in Debian etc) -- I would benefit if
numexpr supported fancy indexing. In my task I need to perform lots of simple
operations (sum) across given set of columns, e.g. if X is an array, I need to
do something like
ixs = [[1,2,10], [1,2,20]....]
[np.sum(X[:, ixs], axis=1) for ixs in ixs]
so far the quickest "pure-Python" way I have is to use a coo sparse matrix with
entries for those columns and then doing matrix product between X and that
sparse "index" matrix.
Not sure if my actual case could be anyhow addressed by numexpr, but having a
generic ability to evaluate something like
"X[:, ixs] + 2*Y[ixs]"
could indeed be useful. Thanks
Original comment by yarikop...@gmail.com
on 4 Mar 2012 at 4:48
This would imply a major rewrite of numexpr, and having other solutions that
does that (like Numba), I don't think it is realistic to implement this in
numexpr itself. So closing this.
Original comment by fal...@gmail.com
on 29 Apr 2013 at 10:29
Original issue reported on code.google.com by
maahn...@googlemail.com
on 22 Sep 2011 at 12:02