code: def todataframe(table, index=None, exclude=None, columns=None,
                  coerce_float=False, nrows=None):
      
      import pandas as pd
      l = list(table)
      data = l[1:]
      if columns is None:
          columns = l[0]
      return pd.DataFrame.from_records(data, index=index, exclude=exclude,
                                       columns=columns, coerce_float=coerce_float,
                                       nrows=nrows)
docs: Load data from the given `table` into a
      `pandas <http://pandas.pydata.org/>`_ DataFrame. E.g.::
  
          >>> import petl as etl
          >>> table = [('foo', 'bar', 'baz'),
          ...          ('apples', 1, 2.5),
          ...          ('oranges', 3, 4.4),
          ...          ('pears', 7, .1)]
          >>> df = etl.todataframe(table)
          >>> df
                 foo  bar  baz
          0   apples    1  2.5
          1  oranges    3  4.4
          2    pears    7  0.1