Skip to content
Advertisement

How to replace several values of a column using lists in python

I have a dataframe name “detalhe” with several columns and one is named: “Concelho”. I have a list of unique values of “Concelho” named “Concelho ADENE” and I would like to replace each occurrence with a different list called “INE”.

JavaScript

Both lists have the same length and each entrance correspond (they are alphanumeric sorted) (I also have a csv file with both lists as 2 parallels columns.)

I tried:

JavaScript

Advertisement

Answer

could you please provide a sample code(like below) to check to reproduce the scenario? replacing using list is working fine

JavaScript

output:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement