Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
297 B
3
Indexable
Never
def profession(df):
    if 'data-analyst' in df:
        return 'data-analyst'
    elif 'data-scientist' in df:
        return 'data-scientist'
    elif 'data-science' in df:
        return 'data-scientist'
    return df
        
df['profession'] = df['profession_name'].apply(profession)