def rec_keep_fields(rec, names):
 if cbook.is_string_like(names):
  names = names.split(u',')
 arrays = []
 for name in names:
  arrays.append(rec[name])
 return np.rec.fromarrays(arrays, names=names)

def rec_keep_fields ( rec , names ) : if cbook . is_string_like ( names ) : names = names . split ( u',' ) arrays = [ ] for name in names : arrays . append ( rec [ name ] ) return np . rec . fromarrays ( arrays , names = names )
return a new numpy record array with only fields listed in names .