Merlijn van Deen <valhallasw at gmail.com> added the comment: numpy.sign does this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.sign.html ---------- nosy: +valhallasw _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue829370> _______________________________________