# .raw. car\_names reassignation

**URL:** <https://discourse.scverse.org/t/raw-car-names-reassignation/3872>\
**Category:** anndata\
**Created:** [November 20, 2025, 2:31am UTC](https://discourse.scverse.org/t/raw-car-names-reassignation/3872 "2025-11-20T02:31:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bontix-77](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/bontix-77/32/1527_2.png) [@bontix-77](https://discourse.scverse.org/u/bontix-77)\
**Post date:** [November 20, 2025, 2:31am UTC](https://discourse.scverse.org/t/raw-car-names-reassignation/3872/1 "2025-11-20T02:31:02Z")

</div>

After SeuratDisk the raw.var\_names contain the numeric index while raw.var[‘\_index’] contain the gene symbols. I need to swap the two but raw data are no mutable, is all locked. Suggestions?

---

<div class="post-metadata">

**Author:** ![mschilli](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/mschilli/32/1450_2.png) [@mschilli](https://discourse.scverse.org/u/mschilli)\
**Post date:** [November 20, 2025, 2:21pm UTC](https://discourse.scverse.org/t/raw-car-names-reassignation/3872/2 "2025-11-20T14:21:49Z")

</div>

Not sure I understand, but why not simply get a fresh AnnData from `.raw`, and copy its `var` over? You could use a layer (`'count’`?) instead of `.raw` for downstream analyses to avoid issues like that.  
Alternatively, consider not using `SeuratDisk`. Not sure what’s your exact use case but `anndataR` can read/write `Seurat` objects from/to H5AD files that _should_ be compatible with whatever you do on the Python side.

If you provide some more details, I (or someone else) might be able to give you a more helpful response.

---

<div class="post-metadata">

**Author:** ![bontix-77](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/bontix-77/32/1527_2.png) [@bontix-77](https://discourse.scverse.org/u/bontix-77)\
**Post date:** [November 20, 2025, 4:34pm UTC](https://discourse.scverse.org/t/raw-car-names-reassignation/3872/3 "2025-11-20T16:34:24Z")

</div>

found the solution. adata.raw.var.set\_index(adata.raw.var[“\_index”], inplace=True)
