You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wrote the following function on discourse which converts an arbitrary NamedArray to a DataFrame
julia> function iteratenames(t)
dns = (:count, dimnames(t)...)
nms = names(t)
out = map(vec(CartesianIndices(t))) do i
val = t[i]
indices = ntuple(length(nms)) do j
nms[j][i[j]]
end
vals = (val, indices...)
NamedTuple{dns}(vals)
end
DataFrame(out)
end
We could probably implement a small conversion to something that satisfied the Tables.jl interface and make it easier for people to do crosstabs that return tables.
The text was updated successfully, but these errors were encountered:
I just wrote the following function on discourse which converts an arbitrary
NamedArray
to aDataFrame
We could probably implement a small conversion to something that satisfied the Tables.jl interface and make it easier for people to do crosstabs that return tables.
The text was updated successfully, but these errors were encountered: