I have a fairly large survey dataset (100+ columns and 5000 rows) that has a bunch of string variables.
I can use the following function to convert individual columns one by one,
function fix_df_column(df)
levels = ["x"]
Colname = categorical(df[!, :Colname]; levels, ordered = false)
df[!, :Colname] = Colname
#df
end
but I would like to be able to iterate across the whole dataframe and convert everything automatically.
The only code I can find relates to arrays https://dataframes.juliadata.org/stable/man/categorical/ and the only examples I can find are changes to single columns, not multiple.
Does anyone know a simpler way to achieve this?
Thanks