Fork me on GitHub

biom-format.org

biom.table.Table.ids

«  biom.table.Table.head   ::   Contents   ::   biom.table.Table.index  »

biom.table.Table.ids

Table.ids(axis='sample')

Return the ids along the given axis

Parameters:

axis : {‘sample’, ‘observation’}, optional

Axis to return ids from. Defaults to ‘sample’

Returns:

1-D numpy array

The ids along the given axis

Raises:

UnknownAxisError

If provided an unrecognized axis.

Examples

>>> import numpy as np
>>> from biom.table import Table

Create a 2x3 BIOM table:

>>> data = np.asarray([[0, 0, 1], [1, 3, 42]])
>>> table = Table(data, ['O1', 'O2'], ['S1', 'S2', 'S3'])

Get the ids along the observation axis:

>>> print table.ids(axis='observation')
['O1' 'O2']

Get the ids along the sample axis:

>>> print table.ids()
['S1' 'S2' 'S3']

«  biom.table.Table.head   ::   Contents   ::   biom.table.Table.index  »