Python code for counting number of zero crossings in an array,"sum(1 for i in range(1, len(a)) if a[i - 1] * a[i] < 0)"