• + 2 comments
    l = [1 if x >0 else -1 for x in arr if x != 0]
    print("%.6f" % float(l.count(1)/n))
    print("%.6f" % float(l.count(-1)/n))
    print("%.6f" % float(abs(len(l)-n) /n))