You are viewing a single comment's thread. Return to all comments →
Could not shorten this further
def plusMinus(arr): arr = [i/abs(i) if i != 0 else 0 for i in arr] print(float(arr.count(1))/float(len(arr)), "\n", float(arr.count(-1))/float(len(arr)), "\n",float(arr.count(0))/float(len(arr)))
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Could not shorten this further