Is there a way to replace values in a DataFrame column based on a Dict() of corresponding values:
#Read the CSV file and transform it into a DataFrame
rain_data = CSV.read("data/historico_precipitaciones.csv", DataFrame)
#Rename the columns
colnames = ["Year", "Month", "mm", "Days"]
#Symbol is the type of object used to represent the labels of a dataset
rename!(rain_data, Symbol.(colnames))
#We use a dictionary to translate de Month names
translate = Dict(
"Enero" => "January",
"Febrero" => "February",
"Marzo" => "March",
"Abril" => "April",
"Mayo" => "May",
"Junio" => "June",
"Julio" => "July",
"Agosto" => "August",
"Septiembre" => "September",
"Noviembre" => "November",
"Diciembre" => "December"
)
for i in 1:length(rain_data[:,:Month])
rain_data[i,:Month] = translate[rain_data[i,:Month]]
end
but instead of the for loop doing something like:
replace!(rain_data.Month, translate)