anndata.acc.MetaAcc#
- class anndata.acc.MetaAcc[R: AdRef[str | None, AnnDataLikeMetadataOnly]](dim, *, ref_class, scope=None, frame_acc=None)[source]#
Bases:
DFAcc[R]Reference accessor for arrays from metadata containers (
A.obs/A.var).Examples
You can refer to columns or the index in the way you would access them in a
DataFrame:>>> from anndata.acc import A, MetaAcc >>> assert isinstance(A.obs, MetaAcc) >>> A.obs["type"] A.obs['type'] >>> A.var.index A.var.index
Attributes
- frame_acc: RefAcc | None = None#
Accessor for the data frame this
.DFcast refers into, e.g.A.obsm['df']forA.obsm['df'].DF.
- scope: ScopeAcc | None = None#
Accessor for the element whose
.ADcast this accessor is in, e.g.A.uns['a']forA.uns['a'].AD.obsm['x'].DF.If
None, this accessor refers into the object passed toget()/set()/isin()itself.
Methods
- dims(k, /)[source]#
Get along which dimensions the referenced array is.
- Return type:
Collection[Literal['obs','var']]