| name | great-tables-1-keep-tables-focused |
| description | Sub-skill of great-tables: 1. Keep Tables Focused (+3). |
| version | 1.0.0 |
| category | data-analysis |
| type | reference |
| scripts_exempt | true |
1. Keep Tables Focused (+3)
1. Keep Tables Focused
df_display = df[["Name", "Revenue", "Growth"]]
table = GT(df_display)
2. Use Appropriate Formatting
table = (
GT(df)
.fmt_currency(columns="Price", currency="USD")
.fmt_percent(columns="Growth", decimals=1)
.fmt_integer(columns="Units", use_seps=True)
)
3. Limit Rows for Display
df_top10 = df.nlargest(10, "Revenue")
table = GT(df_top10)
4. Use Color Sparingly
table.data_color(
columns="Performance",
palette=["#fee2e2", "#dcfce7"],
domain=[0, 100]
)