anndata.AnnData.var_vector

AnnData.var_vector(k, *, layer=None)

Convenience function for returning a 1 dimensional ndarray of values from X, layers[k], or obs.

Made for convenience, not performance. Intentionally permissive about arguments, for easy iterative use.

Parameters
k

Key to use. Should be in obs_names or var.columns.

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

What layer values should be returned from. If None, X is used.

Return type

ndarray

Returns

  • A one dimensional nd array, with values for each var in the same order

  • as var_names.