napistu.utils.display_utils
Functions
|
Show a table using the appropriate method for the environment. |
- napistu.utils.display_utils._create_left_align_formatters(df)
Create formatters for left-aligning string columns.
- napistu.utils.display_utils._in_jupyter_environment()
Check if running in Jupyter notebook/lab.
- napistu.utils.display_utils._show_as_string(obj, headers='keys', hide_index=False, max_rows=20, left_align_strings=True)
Show object using string representation with styling support.
- Parameters:
obj (DataFrame or Styler) – Object to display
headers (str, list, or None) –
“keys”: use current column names
None: suppress column names
list: override column names
hide_index (bool) – Whether to hide the row index
max_rows (int) – Maximum number of rows to display
left_align_strings (bool) – Should strings be left aligned?
- napistu.utils.display_utils.show(obj, method='auto', headers='keys', hide_index=False, left_align_strings=True, max_rows=20)
Show a table using the appropriate method for the environment.
- Parameters:
obj (pd.DataFrame or any other object) – The object to show
method (str) – The method to use to show the object - “string” : show the object as a string - “jupyter” : show the object in a Jupyter notebook - “auto” : show the object in a Jupyter notebook if available, otherwise show as a string
headers (str, list, or None) – The headers to use for the object
left_align_strings (bool) – Should strings be left aligned?
max_rows (int) – The maximum number of rows to show
- Return type:
None
Examples
>>> show(pd.DataFrame({"a": [1, 2, 3]}), headers="keys", hide_index=True)