ooguntola / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

Add np.sign function #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'd like to use numexpr to calculate soft thresholding:
np.sign(x) * np.maximum(abs(x)-l, 0)

in numexpr, one might want to use std::copysign as an optimisation, but that's 
another matter.

Original issue reported on code.google.com by pierre.c...@gmail.com on 7 Jun 2012 at 2:48