libgs.database.CommsLog.put_df

CommsLog.put_df(table, df, index=False, if_exists='append')

Add dataframe to database, appending metadata for when it was added

Certain types will be encoded (bytearrays, dates,…) so that the data actually entered in the database is usually strings. This process is automatically reversed by the get_df method and as such is transparent to the user.

Parameters:
  • table (str) – The table
  • df (pandas.DataFrame) – The pandas.DataFrame to add (must have the correct headers)
  • index (bool) – If true: add index as well
  • if_exists (str) – What to do if table exists (directly passed to pd.to_sql method)
Returns:

None