I wish to apply a function to all eltype(col) <: Number columns in a DataFrame and create a new column for each input column.
I am doing
f = identify # for example
function tmp(a)
for n in names(a)
if eltype(a[!, n]) <: Number
a[!, n*"_binned"] = f(a[!, n])
end
end
a
end
tmp(dataframe)
I feel there could be a more elegant way to do this in DataFrames.jl