Skip to main content
`Ctrl`+`K`

# skbio.metadata.SampleMetadata.to_dataframe

SampleMetadata.to_dataframe(encode_missing=False)

  Create a pandas dataframe from the metadata.

  The dataframe’s index name (`Index.name`) will match this metadata object’s `id_header`, and the index will contain this metadata object’s IDs. The dataframe’s column names will match the column names in this metadata. Categorical columns will be stored as `dtype=object` (containing strings), and numeric columns will be stored as `dtype=float`.

  Parameters:
    encode_missing bool, optional

      Whether to convert missing values (NaNs) back into their original vocabulary (strings) if a missing scheme was used.

  Returns:
    pandas.DataFrame

      Dataframe constructed from the metadata.