Sc.get.obs_df function

Hi I can get this function to work using pbmc dataset:

pbmc = sc.datasets.pbmc68k_reduced(),
plotdf = sc.get.obs_df(
pbmc,
keys=[“CD8A”, “n_genes”]
)

But I when I apply this function to my adata, I get this error message:

KeyError: “Could not find keys ‘[‘CD8A’]’ in columns of adata.obs or in adata.var_names.”

Can you help?

That’s… interesting. It definitely should work. Try updating your versions of scanpy and anndata? If that doesn’t work, could you check "CD8A" in pbmc.var_names?