# No unique function for adata.obs

**URL:** <https://discourse.scverse.org/t/no-unique-function-for-adata-obs/1287>\
**Category:** scanpy\
**Tags:** scvi\
**Created:** [April 5, 2023, 10:49pm UTC](https://discourse.scverse.org/t/no-unique-function-for-adata-obs/1287 "2023-04-05T22:49:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Behzad](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Behzad](https://discourse.scverse.org/u/Behzad)\
**Post date:** [April 5, 2023, 10:49pm UTC](https://discourse.scverse.org/t/no-unique-function-for-adata-obs/1287/1 "2023-04-05T22:49:56Z")

</div>

I am using

> scanpy

(and

> scvi

) for my scRNAseq data analysis I added sample names under adata.obs (adata from different samples are concatenated). I would like to get unique name of every sample using the following command:

> adata.obs.sample.unique().tolist()

but getting error and error message is “sample does not have unique function”. when I checked the functions of sample, I noticed that sample does not have any function. do you maybe know what the problem is?

---

<div class="post-metadata">

**Author:** ![danamcc](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@danamcc](https://discourse.scverse.org/u/danamcc)\
**Post date:** [April 7, 2023, 3:45pm UTC](https://discourse.scverse.org/t/no-unique-function-for-adata-obs/1287/2 "2023-04-07T15:45:17Z")

</div>

Try this:  
sample\_list = unique(adata.obs.sample)  
I think the issue is that the anndata object itself doesn’t have the unique function, but calling adata.obs.sample first gives you a list to then manipulate.  
I hope this helps!
