skbio.metadata.MetadataColumn#
- class skbio.metadata.MetadataColumn(series, missing_scheme='blank')[source]#
Abstract base class representing a single metadata column.
Concrete subclasses represent specific metadata column types, e.g.
CategoricalMetadataColumn
andNumericMetadataColumn
.See the
Metadata
class docstring for details aboutMetadata
andMetadataColumn
objects, including a description of column types.The main difference in constructing
MetadataColumn
vsMetadata
objects is thatMetadataColumn
objects are constructed from apandas.Series
object instead of apandas.DataFrame
. Otherwise, the same restrictions, considerations, and data normalization are applied as withMetadata
objects.- Parameters:
- seriespd.Series
The series to construct a column from.
- missing_scheme“blank”, “no-missing”, “INSDC:missing”
How to interpret terms for missing values. These will be converted to NaN. The default treatment is to take no action.
Attributes
id_count
Number of metadata IDs.
id_header
Name identifying the IDs associated with the metadata.
ids
IDs associated with the metadata.
missing_scheme
Return the vocabulary used to encode missing values.
name
Metadata column name.
type
Built-ins
__eq__
(other)Determine if this metadata column is equal to another.
__ge__
(value, /)Return self>=value.
__getstate__
(/)Helper for pickle.
__gt__
(value, /)Return self>value.
__le__
(value, /)Return self<=value.
__lt__
(value, /)Return self<value.
__ne__
(other)Determine if this metadata column is not equal to another.
__str__
(/)Return str(self).
Methods
Filter out missing values from the metadata column.
filter_ids
(ids_to_keep)Filter metadata column by IDs.
get_ids
([where_values_missing])Retrieve IDs matching search criteria.
Return a series containing only missing values (with an index).
get_value
(id)Retrieve metadata column value associated with an ID.
Determine if the metadata column has one or more missing values.
save
(filepath[, ext])Save a TSV metadata file.
to_dataframe
([encode_missing])Create a pandas dataframe from the metadata column.
to_series
([encode_missing])Create a pandas series from the metadata column.