anndata icon indicating copy to clipboard operation
anndata copied to clipboard

MultiIndex for obs/var

Open VolkerBergen opened this issue 4 years ago • 1 comments

Can we enable pd.MultiIndex for obs/var?

I assume that should be implemented somewhere here? Would that be doable?

VolkerBergen avatar Mar 12 '21 15:03 VolkerBergen

What do you expect to work which doesn’t? Some specific examples would be nice. Is this about indexing using a pandas.MultiIndex instance and that doesn’t behave as expected or do you want to index with, say, a list of tuples and that doesn’t work as expected? What does “doesn’t work as expected” mean in this case? Is there an error or (worse) wrong behavior?

At a glance, passing in a pandas.MultiIndex instance like ad[pd.MultiIndex(...), :] should probably work? What’s a MultiIndex’s dtype?

https://github.com/theislab/anndata/blob/2723c9c9e8bc0fe50a9513f292916616a603923b/anndata/_core/index.py#L85-L104

Please help out with some proactive investigation for feature requests like this, that makes it much more pleasant to get started!

flying-sheep avatar Mar 14 '21 13:03 flying-sheep