I have a tuple tp = tuple([randstring(8) for i=1:5], rand(5)]
. Now it’s a tuple of arrays of the same length. How do I convert it to a DataFrame in the case where there are the number of arrays in the tuple is not known before hand?
function ntuple2dataframe(tp::NTuple)
# what goes here
end
I tried
DataFrame(tp)
DataFrame(;Dict(i=>tp1 for (i,tp1) in enumerate(tp)))
but neither worked.