# Assign multiindex later to data variable

**URL:** <https://discourse.pymc.io/t/assign-multiindex-later-to-data-variable/13239>\
**Category:** v5\
**Tags:** modeling\
**Created:** [November 4, 2023, 8:17am UTC](https://discourse.pymc.io/t/assign-multiindex-later-to-data-variable/13239 "2023-11-04T08:17:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HJAM](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@HJAM](https://discourse.pymc.io/u/HJAM)\
**Post date:** [November 4, 2023, 8:17am UTC](https://discourse.pymc.io/t/assign-multiindex-later-to-data-variable/13239/1 "2023-11-04T08:17:37Z")

</div>

Hi,

Following the [tip](https://discourse.pymc.io/t/pymc-arviz-how-to-make-the-most-of-labeled-coords-and-dims-in-pymc-4-0/9581/8) of @jessegrabowski I add a `pd.MultiIndex` to my fit as follows:

` fit.posterior.coords.update({'multiidx': train_data.index})`

Next, I want to assign `multiidx` as coords to one of my data variables, `p`.  
At the moment `p` has the following coordinates:

`(chain, draw, p_dim_0)`

How do I replace `p_dim_0` with `multiidx`?  
How do I remove `chain` and `draw` and only use `multiindex`/

Thanks
