scanpy.get.var_df

scanpy.get.var_df(adata, keys=(), varm_keys=(), *, layer=None)

Return values for observations in adata.

Parameters
adata : AnnDataAnnData

AnnData object to get values from.

keys : Iterable[str]Iterable[str] (default: ())

Keys from either .obs_names, or .var.columns.

varm_keys : Iterable[Tuple[str, int]]Iterable[Tuple[str, int]] (default: ())

Tuple of (key from varm, column index of varm[key]).

layer : str | NoneOptional[str] (default: None)

Layer of adata to use as expression values.

Return type

DataFrameDataFrame

Returns

A dataframe with adata.var_names as index, and values specified by keys and varm_keys.