Question #680375 on Yade changed:
https://answers.launchpad.net/yade/+question/680375

    Status: Open => Answered

Robert Caulk proposed the following answer:
I guess it's a python question.

import numpy as np

def delBelowPercentile(a, q):
    maxRad = np.percentile(a,q)
    for b in bodyRadius:
       if b[0].shape.radius <= maxRad:
           O.bodies.erase(b[0].id)

bodyRadius = []
for b in O.bodies:
    if isinstance(b.shape,Sphere):
        bodyRadius.append([b,b.shape.radius])

bodyRadius.sort(key=lambda x: x[1])
delBelowPercentile(bodyRadius,10)

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to