INNER CODE UNIT · Python
_dataframe_to_rich_table
aeturrell/skimpy · src/skimpy/__init__.py:221
def _dataframe_to_rich_table(
table_name: str,
df: pd.DataFrame,
number: str = "cyan",
category: str = "magenta",
datetime: str = "red",
string: str = "green",
bool: str = "turquoise2",
object: str = "medium_purple1",
) -> Table:
"""Converts a dataframe into a rich table.
To pretty print a dataframe to the console or interactive console, it needs
to first be converted into a rich table. This function performs that
conversion and also colours entries in tables depending on their broad
datatype. This function processes summaries (themselves dataframes) and is
used to produce a table for each data type in the dataframe to be skimmed.
A list of standard colours may be found at