def make_non_empty_sample_lists(fields, headers, mdata):
 fsi = make_field_set_iterable(headers, fields, mdata)
 samples = mdata[:, 0]
 f_inds = [headers.index(i) for i in fields]
 metadata = mdata[:, f_inds]
 sample_groups = []
 value_groups = []
 for value_set in fsi:
  (rows,) = (metadata == value_set).all(1).nonzero()
  if (rows.size > 0):
   sample_groups.append(samples[rows])
   value_groups.append(value_set)
  else:
   pass
 return (sample_groups, value_groups)

def make_non_empty_sample_lists ( fields , headers , mdata ) : fsi = make_field_set_iterable ( headers , fields , mdata ) samples = mdata [ : , 0 ] f_inds = [ headers . index ( i ) for i in fields ] metadata = mdata [ : , f_inds ] sample_groups = [ ] value_groups = [ ] for value_set in fsi : ( rows , ) = ( metadata == value_set ) . all ( 1 ) . nonzero ( ) if ( rows . size > 0 ) : sample_groups . append ( samples [ rows ] ) value_groups . append ( value_set ) else : pass return ( sample_groups , value_groups )
return non-empty sample lists for corresponding field value sets .