ehrapy.anndata.type_overview

ehrapy.anndata.type_overview(data, sort_by=None, sort_reversed=False)[source]

Prints the current state of an AnnData object in a tree format.

Output can be printed in sorted format by using one of dtype, order, num_cats or None, which sorts by data type, lexicographical order, number of unique values (excluding NaN’s) and unsorted respectively. Note that sorting by num_cats only affects encoded variables currently and will display unencoded vars unsorted.

Parameters:
  • data (AnnData) – AnnData object to display

  • sort_by (str | None) – How the tree output should be sorted. One of dtype, order, num_cats or None (Defaults to None -> unsorted)

  • sort_reversed (bool) – Whether to sort in reversed order or not

Return type:

None

Examples

>>> import ehrapy as ep
>>> adata = ep.dt.mimic_2(encoded=True)
>>> ep.ad.type_overview(adata)