SHARE
TWEET

Untitled

a guest Jan 14th, 2020 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def has_builder_func(builder):
  2.   def inner(row):
  3.     for b, failed in row['bbs']:
  4.       if b == builder and failed == 'true':
  5.         return 1
  6.     return 0
  7.   return inner
  8.  
  9. to_cluster = main_data.copy(deep=True)
  10. for i, builder in enumerate(all_builders):
  11.   to_cluster['builder_%s' % builder] = to_cluster.apply(has_builder_func(builder), axis=1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top