Guest User

Untitled

a guest
May 24th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. # convert strange data to good
  2. names = [name for name in train.keys() if name[0]=='P']
  3. multiplier = {'P1':3,'P2':1.5,'P3':1.5,'P4':1.5,'P5':2,'P6':2,'P7':2,'P8':2,'P9':2,'P10':2,'P11':2,'P12':2,'P13':1.5,'P14':3,
  4. 'P15':2,'P16':3,'P17':3,'P18':3,'P19':5,'P20':3,'P21':3,'P22':1,'P23':5,'P24':2,'P25':2,'P26':2.5,'P27':2.5,
  5. 'P28':2.5,'P29':2.5,'P30':5,'P31':3,'P32':5,'P33':2,'P34':6,'P35':3,'P36':4,'P37':2}
  6.  
  7. for i in range(0,len(train)):
  8. if train.iloc[i]['max_params'] > 5:
  9. for name in names:
  10. train.loc[i,name] /= multiplier[name]
Advertisement
Add Comment
Please, Sign In to add comment