malariagen_data.af1.Af1.count_samples#

Af1.count_samples(sample_sets: Sequence[str] | str | None = None, sample_query: str | None = None, sample_query_options: dict | None = None, index: str | Sequence[str] = ('country', 'admin1_iso', 'admin1_name', 'admin2_name', 'year'), columns: str | Sequence[str] = 'taxon') DataFrame#

Create a pivot table showing numbers of samples available by space, time and taxon.

Parameters#

sample_setssequence of str or str or None, optional

List of sample sets and/or releases. Can also be a single sample set or release.

sample_querystr or None, optional

A pandas query string to be evaluated against the sample metadata, to select samples to be included in the returned data.

sample_query_optionsdict or None, optional

A dictionary of arguments that will be passed through to pandas query() or eval(), e.g. parser, engine, local_dict, global_dict, resolvers.

indexstr or sequence of str, optional, default: (‘country’, ‘admin1_iso’, ‘admin1_name’, ‘admin2_name’, ‘year’)

Sample metadata columns to use for the pivot table index.

columnsstr or sequence of str, optional, default: ‘taxon’

Sample metadata columns to use for the pivot table columns.

Returns#

DataFrame

Pivot table of sample counts. One row per admin2_year cohort. Unless otherwise specified using the columns parameters, the samples are grouped according to their taxon and then counted.