Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- company_id,company_name
- 1,Amazon
- 1,Amazon Ltd
- 2,Google
- 1,Amazon
- 2,Gogle
- 3,Facebook Ltd
- 3,Facebook LTD
- 1,AMAZON
- 1,AMAZON LTD
- 2,GOOGLE
- 3,Facebook
- 3,Face book
- company_id,company_name
- 1,Amazon
- 1,Amazon
- 2,Google
- 1,Amazon
- 2,Google
- 3,Facebook
- 3,Facebook
- 1,Amazon
- 1,Amazon
- 2,Google
- 3,Facebook
- 3,Facebook
- dd = df.drop_duplicates().set_index('company_id').to_dict()['company_name']
- df.company_name = df.company_id
- df.company_name = df.company_name.replace(dd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement