Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
283 B
12
Indexable
Never
#1
df = df.replace({'locality_name': {'поселок':'посёлок'}})

#2

for i in df['locality_name']:
    try:
        if 'поселок' in i.split():
            df['locality_name'] = df['locality_name'].replace('поселок', 'посёлок')
    except:
        pass