question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

highly_variable_genes AssertionError: Don’t call _normalize_index with non-categorical/string names

See original GitHub issue

Hi, I am using anndata 0.6.21 and scanpy 1.4.3 I executed this code:

sc.pp.highly_variable_genes(adata, min_mean=0.0001, max_mean=3, min_disp=0.5)

sc.pl.highly_variable_genes(adata)

adata = adata[:, adata.var['highly_variable']]

and I got this error: AssertionError: Don’t call _normalize_index with non-categorical/string names Can you help me?

Thank you.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
maximilianhcommented, Jul 30, 2019

I had the same problem when I loaded sample data from a csv as a data frame and assigned it to adata.obs = df

1reaction
scottgigante-immunaicommented, Sep 9, 2022

Solution here is adata.obs.index = adata.obs.index.astype(str). Should be called by default if this assertionerror is raised.

Read more comments on GitHub >

github_iconTop Results From Across the Web

highly_variable_genes AssertionError: Don't call ... - GitHub
Hi, I am using anndata 0.6.21 and scanpy 1.4.3 I executed this code: sc.pp.highly_variable_genes(adata, min_mean=0.0001, max_mean=3, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found