Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3.  
  4. raw_data = {
  5. 'Score1': [42, 52, -999, 24, 73],
  6. 'Score2': [-999, -999, -999, 2, 1],
  7. 'Score3': [2, 2, -999, 2, -999]}
  8. df = pd.DataFrame(raw_data, columns = ['Score1', 'Score2', 'Score3'])
  9.  
  10. df.loc[:,('Score2', 'Score3')].replace(-999, np.nan, inplace=True)
  11. df
Add Comment
Please, Sign In to add comment