mardi 7 janvier 2020

Comparing DataFrame Column with another List and change

Good Day,

I have a PandasDataFrame with a column 'Cityname' and another list of 'BigCities' For each row in the column 'Cityname' I would like to exchange the Cityname when the city is in the list of 'BigCities' to 1 or if not 0.

Can anyone help with that. I Have problems when it comes to two lists when comparing.

Thank you kindly.

Regards

Peter

Aucun commentaire:

Enregistrer un commentaire