calour.amplicon_experiment.AmpliconExperiment.from_pandas

classmethod AmpliconExperiment.from_pandas(df, exp=None)[source]

Convert a Pandas DataFrame into an experiment.

Can use an existing calour Experimebt (exp) (if supplied) to obtain feature and sample metadata. Note currently only works with non-sparse DataFrame

Parameters:
  • df (Pandas.DataFrame) – The dataframe to use. should contain samples in rows, features in columns. Index values will be used for the sample_metadata index and column names will be used for feature_metadata index
  • exp (Experiment, optional) – If not None, use sample and feature metadata from the experiment
Returns:

with non-sparse data

Return type:

Experiment