Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df.loc[df.location.str.contains('CA'), 'location'] = 'USA'
- df.loc[df.location.isin(state_list), 'location'] = 'USA'
- for states in state_list:
- if df.loc[df.location.isin(state_list)]:
- df['location'] = 'USA'
Add Comment
Please, Sign In to add comment