def filter_otu_table_to_n_samples(otu_table, n):
 if (not (0 < n <= len(otu_table.ids()))):
  raise ValueError('Number of samples to filter must be between 0 and the number of samples.')
 return otu_table.subsample(n, axis='sample', by_id=True)

def filter_otu_table_to_n_samples ( otu_table , n ) : if ( not ( 0 < n <= len ( otu_table . ids ( ) ) ) ) : raise ValueError ( 'Number of samples to filter must be between 0 and the number of samples.' ) return otu_table . subsample ( n , axis = 'sample' , by_id = True )
filter otu table to n random samples .