Fork me on GitHub

biom-format.org

biom.table.Table.to_dataframe

«  biom.table.Table.sum   ::   Contents   ::   biom.table.Table.to_hdf5  »

biom.table.Table.to_dataframe

Table.to_dataframe()

Convert matrix data to a Pandas SparseDataFrame

Returns:

pd.SparseDataFrame

A SparseDataFrame indexed on the observation IDs, with the column names as the sample IDs.

Notes

Metadata are not included.

Examples

>>> from biom import example_table
>>> df = example_table.to_dataframe()
>>> df
     S1   S2   S3
O1  0.0  1.0  2.0
O2  3.0  4.0  5.0

«  biom.table.Table.sum   ::   Contents   ::   biom.table.Table.to_hdf5  »