I’m trying to do the following. I have a function foo(x, d::DataFrame) and a 1 dimensional array a of data for which I want to call the function for each element. Problem is I want to pass a DataFrame df too but when I execute:
.foo(a, df)
It’s not the dataframe that is used but, logically, the elements in the dataframe.
I tried to work around this by creating a one dimensional array as follows:
dfa = Array{DataFrame}(undef, 1, length(a))
dfa .= df
But then I get the following error upon assignment:
ERROR: DimensionMismatch: array could not be broadcast to match destination
When I do the same with an Integer type
ia = Array{Integer}(undef, 1, length(a))
ia .= 2
everything works just fine.
So why does the same type of code raise an error when the type is a DataFrame???
Optionally, is there a way to pass the DataFrame without putting it in an Array?