baybe.utils.dataframe.pretty_print_df

baybe.utils.dataframe.pretty_print_df(df: DataFrame, max_rows: int = 6, max_columns: int = 4, max_colwidth: int = 16, precision: int = 3)[source]

Convert a dataframe into a pretty/readable format.

This function returns a customized str representation of the dataframe. In case the dataframe is empty, it returns a corresponding statement.

Parameters:
  • df (DataFrame) – The dataframe to be printed.

  • max_rows (int) – Maximum number of rows to display.

  • max_columns (int) – Maximum number of columns to display.

  • max_colwidth (int) – Maximum width of an individual column.

  • precision (int) – Number of digits to which numbers should be rounded.

Return type:

str

Returns:

The values to be printed as a str table.