Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def clean_heroes(heroes):
- temp = heroes.copy()
- temp = temp.replace('-', np.NaN)
- temp = temp.replace('No Hair', np.NaN)
- replace_neg = lambda x : x if x > 0 else np.NaN
- temp['Height'] = temp['Height'].apply(replace_neg)
- temp['Weight'] = temp['Weight'].apply(replace_neg)
- return temp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement