Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = len(arr)
- count_z = 0
- count_p = 0
- count_n = 0
- for x in range(0,n):
- if arr[x] == 0:
- count_z += 1
- elif arr[x] > 0:
- count_p += 1
- else:
- count_n += 1
- per_z = "{:.6f}".format(count_z/n)
- per_p = "{:.6f}".format(count_p/n)
- per_n = "{:.6f}".format(count_n/n)
- print (per_p)
- print (per_n)
- print (per_z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement