I turned to numpy
to solve this to limit lines and make into a simple function.
I was able to get a conditional met, separating a list into two, using np.where
to separate out a list. This works for numeric, but this could be expanded using strings and lists I believe.
Here it is...
from numpy import where as wh, array as arrmidz = lambda a, mid: (a[wh(a > mid)], a[wh((a =< mid))])p_ = arr([i for i in [75, 50, 403, 453, 0, 25, 428] if i])high,low = midz(p_, p_.mean())