def select(self, condition, name='<STR_LIT>'):
if condition.__code__.co_argcount == <NUM_LIT:1>:<EOL><INDENT>idx = [(Z, N) for (Z, N), M in self if condition(M)]<EOL><DEDENT>if condition.__code__.co_argcount == <NUM_LIT:2>:<EOL><INDENT>idx = [(Z, N) for (Z, N) in self.index if condition(Z, N)]<EOL><DEDENT>if condition.__code__.co_argcount == <NUM_LIT:3>:<EOL><INDENT>idx = [(Z, N) for (Z, N), M in self if condition(Z, N, M)]<EOL><DEDENT>index = pd.MultiIndex.from_tuples(idx, names=['<STR_LIT>', '<STR_LIT:N>'])<EOL>return Table(df=self.df.ix[index], name=name)<EOL>
Selects nuclei according to a condition on Z,N or M

Parameters
----------
condition : function,
    Can have one of the signatures f(M), f(Z,N) or f(Z, N, M)
    must return a boolean value
name: string, optional name for the resulting Table

Example:
--------
Select all nuclei with A > 160:

>>> A_gt_160 = lambda Z,N: Z + N > 160
>>> Table('AME2003').select(A_gt_160)