anndata.acc.AdRef

anndata.acc.AdRef#

class anndata.acc.AdRef(acc, idx)[source]#

Bases:

A reference to a 1D or 2D array along one or two dimensions of an AnnData object.

Examples

Use A in the same way you would an AnnData object if you wanted to access a 1D or 2D array along the whole dimension. You can then introspect the reference:

>>> from anndata.acc import A
>>> A.obs.index.dims
{'obs'}
>>> A.obs["x"].idx
'x'
>>> type(A.var["y"].acc)
<class 'anndata.acc.MetaAcc'>

See anndata.acc and AdAcc for more examples.

Attributes

dims[source]#

Which dimensions are spanned by the array?

acc: RefAcc[Self, Hashable][source]#

The accessor containing information about this array.

See here for all possible types this can assume.

idx: Hashable[source]#

The index specifying the array.