I need to change all my columns value for some items of my list of list:
import pandas as pd
df = pd.read_csv('test.csv')
df
Sitio,Country,Subastas,Impresiones_exchange
rgg,Perú,32,80
rgg,Perú,30,49
rgg,Estados Unidos,24,15
geos = [['Estados Unidos','US - Estados Unidos'],['Estonia','EE - Estonia']]
I'm trying to change all items of df['Country'] to geo[1:]
if item
of df['Country'] == geo[:1]
for geo in geos:
for item in df['Country']:
if item == geo[:1]:
item = geo[1:]
I need something like this:
Sitio,Country,Subastas,Impresiones_exchange
rgg,Perú,32,80
rgg,,Perú,30,49
rgg,US - Estados Unidos,24,15