docs: def _get_data_from_dataframe(source, fields='*', first_row=0, count=-1, schema=None):
    """ Helper function for _get_data that handles Pandas DataFrames. """
    if schema is None:
      schema = google.datalab.bigquery.Schema.from_data(source)
    fields = get_field_list(fields, schema)
    rows = []
    if count < 0:
      count = len(source.index)
    df_slice = source.reset_index(drop=True)[first_row:first_row + count]
    for index, data_frame_row in df_slice.iterrows():
      row = data_frame_row.to_dict()
      for key in list(row.keys()):
        val = row[key]
        if isinstance(val, pandas.Timestamp):
          row[key] = val.to_pydatetime()
  
      rows.append({'c': [{'v': row[c]} if c in row else {} for c in fields]})
    cols = _get_cols(fields, schema)
    return {'cols': cols, 'rows': rows}, len(source)