# Create a chain object from a dataframe

**URL:** <https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640>\
**Category:** General Usage\
**Tags:** turing\
**Created:** [April 18, 2022, 3:52pm UTC](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640 "2022-04-18T15:52:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![99dB](https://avatars.discourse-cdn.com/v4/letter/9/838e76/32.png) [@99dB](https://discourse.julialang.org/u/99dB)\
**Post date:** [April 18, 2022, 3:52pm UTC](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640/1 "2022-04-18T15:52:27Z")

</div>

Hi all,

I would like to do some statistics using the package MCMCChains on a dataframe object. But it is not working because I think I need to have my chains in a MCMC chain object.

Is there a way to create a chain object from a dataframe containing iterations on the rows and parameters on the columns?

Many thanks.

---

<div class="post-metadata">

**Author:** ![99dB](https://avatars.discourse-cdn.com/v4/letter/9/838e76/32.png) [@99dB](https://discourse.julialang.org/u/99dB)\
**Post date:** [April 18, 2022, 5:19pm UTC](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640/2 "2022-04-18T17:19:10Z")

</div>

Transforming the dataframe in array works actually well:

```julia
Chains(Array(df))

```
