def drop_field(expr, field, *fields):
 to_remove = set((field,)).union(fields)
 new_fields = []
 for field in expr.fields:
  if (field not in to_remove):
   new_fields.append(field)
  else:
   to_remove.remove(field)
 if to_remove:
  raise ValueError(('fields %r were not in the fields of expr (%r)' % (sorted(to_remove), expr.fields)))
 return expr[new_fields]

def drop_field ( expr , field , * fields ) : to_remove = set ( ( field , ) ) . union ( fields ) new_fields = [ ] for field in expr . fields : if ( field not in to_remove ) : new_fields . append ( field ) else : to_remove . remove ( field ) if to_remove : raise ValueError ( ( 'fields %r were not in the fields of expr (%r)' % ( sorted ( to_remove ) , expr . fields ) ) ) return expr [ new_fields ]
drop a field or fields from a tabular expression .