Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3.  
  4. ACTIONS = 't201 t202 t203 t204 t205 t206 t207 t208 t209 t210'.split()
  5.  
  6. df = pd.read_csv('sandbox/10G.prediction')
  7.  
  8. df['left_or_right'] = np.random.choice([True, False], size=df.shape[0])
  9. df['random_action'] = np.random.choice(ACTIONS, size=df.shape[0])
  10. df['final_action'] = np.where(df.left_or_right, df.action, df.random_action)
  11.  
  12. df[['vid', 'final_action']].to_csv('sandbox/10G_handmade_eps05.prediction2', index=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement