code: def addfield(table, field, value=None, index=None, missing=None):
      
  
      return AddFieldView(table, field, value=value, index=index,
                          missing=missing)
docs: Add a field with a fixed or calculated value. E.g.::
  
          >>> import petl as etl
          >>> table1 = [['foo', 'bar'],
          ...           ['M', 12],
          ...           ['F', 34],
          ...           ['-', 56]]
          >>> # using a fixed value
          ... table2 = etl.addfield(table1, 'baz', 42)
          >>> table2
          +-----+-----+-----+
          | foo | bar | baz |
          +=====+=====+=====+
          | 'M' |  12 |  42 |
          +-----+-----+-----+
          | 'F' |  34 |  42 |
          +-----+-----+-----+
          | '-' |  56 |  42 |
          +-----+-----+-----+
  
          >>> # calculating the value
          ... table2 = etl.addfield(table1, 'baz', lambda rec: rec['bar'] * 2)
          >>> table2
          +-----+-----+-----+
          | foo | bar | baz |
          +=====+=====+=====+
          | 'M' |  12 |  24 |
          +-----+-----+-----+
          | 'F' |  34 |  68 |
          +-----+-----+-----+
          | '-' |  56 | 112 |
          +-----+-----+-----+
  
      Use the `index` parameter to control the position of the inserted field.