I am looking for an optimized or cute way to check if all elements of an array have the same signs (strictly).
I thought about it:
N.all(my_array*my_array[0]>0)
since he will check whether all the elements have the same sign as the first, and thereby the same sign, but he does not look pretty or elegant.
source share