How to quantify cell type using scanpy?

Is there a way to find counts per cell type and the its percentage?
I tried to run, add_percentage=True, count_variable='cell_type') but says scanpy doesn’t have the attribute.

Scanpy does not have that function. But I think what you’re looking for is more like:

# or, for frequencies
1 Like

That worked like a charm. Thank you!

1 Like