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:
rand!(Normal(mu[i],sigma[i]), df[!,i])
Edit: There is an issue for switching the argument order to be consistent with Random
, so this might change in a future Distributions.jl release.