# Unstacking/pivoting Turing results

**URL:** <https://discourse.julialang.org/t/unstacking-pivoting-turing-results/121462>\
**Category:** Data\
**Created:** [October 18, 2024, 4:22pm UTC](https://discourse.julialang.org/t/unstacking-pivoting-turing-results/121462 "2024-10-18T16:22:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dreycen\_Foiles](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dreycen_foiles/32/44744_2.png) [@Dreycen\_Foiles](https://discourse.julialang.org/u/Dreycen_Foiles)\
**Post date:** [October 18, 2024, 4:22pm UTC](https://discourse.julialang.org/t/unstacking-pivoting-turing-results/121462/1 "2024-10-18T16:22:29Z")

</div>

I am working with inference results from `Turing.jl`. My data is uneven so I’m modeling it in the “long” format while in the Turing model, but after the inference is done, I’d like to reshape the data into a more structured shape (filling in missing values with `missing` as needed). The Python analogue I’m more familiar with, `xarray`, has [an unstack function](https://docs.xarray.dev/en/latest/generated/xarray.DataArray.unstack.html) that you can use in conjunction with a multi-index. Is there an something like this with `InferenceObjects.jl`/`DimesionalData.jl`? I saw `DimensionalData.jl` has [mergedims](https://rafaqz.github.io/DimensionalData.jl/stable/object_modification#mergedims) and the inverse of that operation is exactly what I think I need.

Maybe there is also a more obvious solution I’m missing?
