Great Tables is a Python library designed to easily generate information-rich, publication-quality display tables from Pandas or Polars DataFrames. It allows for extensive customization of table components like headers, footers, row labels (stubs), spanner labels, and offers various formatting options for cell values, including nanoplots. The current version is 0.21.0, released on March 3, 2026, and it sees active development with regular updates.
pip install great-tablesVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates creating a table using the `GT` class from a Pandas DataFrame (specifically, a built-in dataset). It includes adding a table header and formatting currency and date columns using method chaining. The resulting table automatically renders in notebook environments; for console use, `show()` opens it in a browser.
Call `.show()` on your GT object (e.g., `my_table.show()`) when working outside of a notebook or Quarto environment.
Prioritize passing Polars DataFrames directly to the `GT()` constructor rather than relying on the `DataFrame.style` property for stability.
Review the changelog for specific versions when upgrading, especially if custom HTML output or styling is being used, and adapt code for HTML ID uniqueness or CSS handling.
Always chain methods when applying multiple transformations (e.g., `GT(df).tab_header(...).fmt_currency(...)`) or re-assign the result of a modification to the GT object if performing operations in multiple steps.
Ensure both `great-tables` and `polars` are updated to their latest compatible versions. `pip install --upgrade great-tables polars`
Close all active browser instances (especially those managed by Selenium) and try again. If the issue persists, consider specifying an alternative `web_driver` (e.g., 'edge', 'firefox') or configuring a unique temporary `user-data-dir` for the WebDriver.
```python
# Option 1: Try an alternative browser driver
gt_table.save("output.png", web_driver='edge')
# Option 2: For more advanced control (e.g., with Chrome)
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless") # Run in headless mode
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--user-data-dir=/tmp/great_tables_profile") # Use a unique temporary directory
driver = webdriver.Chrome(options=chrome_options)
gt_table.save("output.png", web_driver=driver)
driver.quit() # Important to quit the driver
```Ensure that `great-tables`, `polars`, and any related extensions (like `gt-extras`) are updated to their latest versions, as this can be due to type inconsistencies. If writing custom logic involving Polars Series in boolean contexts, explicitly use methods like `.any()`, `.all()`, or `.item()` to obtain a single boolean value. `pip install --upgrade great-tables polars gt-extras`
Update `great-tables` to the latest version to get bug fixes. If the error persists, especially when using `data_color()`, try explicitly setting `autocolor_text=False` within that method as a workaround if text auto-coloring is causing the issue.
```python
pip install --upgrade great-tables
# Example workaround if error occurs with data_color()
gt_table.data_color(
columns="your_column",
palette="RdYlGn",
autocolor_text=False # Disable automatic text coloring
)
```