# Loading a h5ad file with HF datasets

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Floading-a-h5ad-file-with-hf-datasets%2F38991%3E%5C
**Category:** 🤗Datasets\
**Created:** [May 7, 2023, 3:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Floading-a-h5ad-file-with-hf-datasets%2F38991 "2023-05-07T15:08:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NathanL](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@NathanL](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FNathanL)%5C
**Post date:** [May 7, 2023, 3:08pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Floading-a-h5ad-file-with-hf-datasets%2F38991%2F1 "2023-05-07T15:08:11Z")

</div>

Hi,  
I’m working with files generated via the AnnData package, i.e my dataset is a .h5ad file containing dataframes and matrices.

> **[Tutorials](https://anndata.readthedocs.io/en/latest/tutorials/index.html)**
>
> For a quick introduction to AnnData, check out Getting Started with AnnData. For working with the experimental data loaders also see Experimental API. Getting started with anndata, Interfacing pyto...

I don’t see the .h5ad format in the list of HF Datasets supported extensions.

Can I still load a dataset of this format?

Best,  
Nathan

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmariosasko)%5C
**Post date:** [May 8, 2023, 7:37pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Floading-a-h5ad-file-with-hf-datasets%2F38991%2F2 "2023-05-08T19:37:34Z")

</div>

Hi!

We don’t have a built-in H5 loader, so you can either use [`Dataset.from_generator`](https://huggingface.co/docs/datasets/loading#python-generator) to load the data or `Dataset.from_dict`/`Dataset.from_pandas` if the data is small enough to fit in memory
