Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. def clean_heroes(heroes):
  2. temp = heroes.copy()
  3. temp = temp.replace('-', np.NaN)
  4. temp = temp.replace('No Hair', np.NaN)
  5. replace_neg = lambda x : x if x > 0 else np.NaN
  6. temp['Height'] = temp['Height'].apply(replace_neg)
  7. temp['Weight'] = temp['Weight'].apply(replace_neg)
  8. return temp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement