# Using current variable values in the naming of DataFrame column(s)

**URL:** <https://discourse.julialang.org/t/using-current-variable-values-in-the-naming-of-dataframe-column-s/68982>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [September 30, 2021, 8:33am UTC](https://discourse.julialang.org/t/using-current-variable-values-in-the-naming-of-dataframe-column-s/68982 "2021-09-30T08:33:39Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![sostock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sostock/32/5546_2.png) [@sostock](https://discourse.julialang.org/u/sostock)\
**Post date:** [September 30, 2021, 11:09am UTC](https://discourse.julialang.org/t/using-current-variable-values-in-the-naming-of-dataframe-column-s/68982/6 "2021-09-30T11:09:39Z")

</div>

Oh, I didn’t see that the `rand!` implementation in `Distributions` wants the distribution first and then the array. The arguments have to be switched:

```julia
rand!(Normal(mu[i],sigma[i]), df[!,i])

```

Edit: There is an [issue](https://github.com/JuliaStats/Distributions.jl/issues/1316) for switching the argument order to be consistent with `Random`, so this might change in a future Distributions.jl release.

---

_[View the full topic](https://discourse.julialang.org/t/using-current-variable-values-in-the-naming-of-dataframe-column-s/68982)._
