I'm trying to create a column with integer values based on a small function that basically uses conditional statements. In short, a reclassification. My attempt below:
def getValue(Etat): if Etat == 'Bon': value = 1 elif Etat == 'Moyen': value = 2 elif Etat == 'Mauvais': value = 3 elif Etat == 'Ruine': value = 4 value = getValue(<Etat>)
While I do not get any errors, the problem is that the new field is not being updated with new values. My thoughts are that it can't find the original field: "Etat", the source.
How should I go about it? Also, what I don't understand how is going to make the updates to the field, surely something is missing.