Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.
中文简介正在准备中。当前显示原文说明。
Python table formatting with great-tables: publication-quality display tables from Polars/pandas DataFrames. GT() grammar-of-tables object, fmt_*() number formatting, tab_*() structure (header, spanners, stub, source notes), tab_style() and data_color() styling, cols_*() column operations, and HTML/LaTeX export via as_raw_html()/write_raw_html()/as_latex(). Use when execution language is Python and the task involves formatted data tables, summary tables, or descriptive-stat tables for reports. R equivalent: gt (use when execution language is R). For regression/model tables in Python, use the estimator's own output (pyfixest etable(), statsmodels summary()) — great-tables has no modelsummary equivalent. For figures/charts use plotnine or plotly, not this skill.
中文简介正在准备中。当前显示原文说明。
实测评分 未实测
查看安装方法安装前可以查看交给 AI 代理的指令内容。
great-tables is the Python implementation of the grammar of tables — the same
grammar as R's gt, by the same author (Rich Iannone, Posit). It builds
publication-quality display tables declaratively by layering formatting, structure,
and style onto a GT() object. Use when execution language is Python and the task
involves creating formatted data tables, cross-tabulations, or descriptive-statistics
tables for reports and papers. great-tables accepts Polars DataFrames natively (DAAF's
default) as well as pandas. For figures use plotnine (static) or plotly
(interactive); for regression/model comparison tables great-tables has no
modelsummary-style helper, so use the estimator's own tabular output instead
(pyfixest etable(), statsmodels .summary()). R counterpart: the gt skill —
substitute it when execution language is R.
great-tables implements a grammar of tables, analogous to plotnine/ggplot2's grammar of graphics but for tabular output:
GT object, so operations chain
with . (Python) rather than R's |> pipefmt_number, fmt_percent, fmt_currency, fmt_date,
fmt_markdown, conditional styling, color scalesGT() (pandas also
accepted; Polars is the DAAF default)Probe-verified against installed 0.21.0 (2026-07-13): all API claims in this
skill and its references were executed against the package. Version-specific caveats
(e.g., grand_summary_rows expecting Polars expressions, cols_merge 0-based
indices, save() needing selenium) are documented at their point of use.
gt.GT(df). The GT.from_data() classmethod is
broken in 0.21.0 (raises TypeError on an internal _tbl_data kwarg) — do not
use it. Probe: 04_extras_a.py in the R_Support sessionF scratch.grand_summary_rows(fns=...) expects Polars expressions, not R-style string
aggregator names. Use {"Total": pl.all().sum()}, not {"Total": "sum"}. It also
does not support the columns= selection argument in 0.21.0 (raises
NotImplementedError) — summaries apply across all numeric columns.cols_merge(pattern=...) uses 0-based {0}, {1} indices — differs from R
gt's 1-based {1}, {2}.as_raw_html, write_raw_html,
as_latex) — no external dependency.save() to PNG/PDF) does NOT work in the DAAF container — it
requires selenium + a headless Chrome driver, neither of which is installed
(and runtime pip install is blocked by DAAF policy). Export tables as HTML
instead. See ./references/export.md.| File | Purpose | When to Read |
|---|---|---|
quickstart.md | GT() from a Polars DataFrame, header/source notes, basic fmt_* formatting | Starting out or need a quick table |
formatting-structure.md | Full fmt_* family, tab_style/data_color styling, spanners, row-group stub, grand summary rows, cols_* operations | Detailed formatting and structure |
export.md | as_raw_html/write_raw_html/as_latex, the save() image limitation, saving into project outputs | Saving or embedding tables |
quickstart.mdformatting-structure.mdexport.md| Skill | Relationship |
|---|---|
gt | R counterpart — same grammar of tables. Use gt when execution language is R; use great-tables when Python |
polars | DAAF's default DataFrame library — great-tables accepts Polars DataFrames directly; build/aggregate the data in Polars, then format with great-tables |
plotnine | Static figures (charts/plots) — use plotnine for figures, great-tables for tables |
plotly | Interactive figures — use plotly for interactive charts, great-tables for tables |
pyfixest | Regression output — great-tables has no modelsummary equivalent; use pyfixest etable() for FE/DiD model tables |
statsmodels | Regression output — use statsmodels .summary() / summary2() for model tables |
data-scientist | Methodology guidance for what to present in tables |
R counterpart: For R pipelines, use the gt skill instead. great-tables and gt
share the grammar of tables but differ in surface details (method chaining vs |>,
0-based vs 1-based cols_merge indices, Polars-expression vs string aggregators in
summary rows, and export capabilities — see Version Notes).
What kind of table?
├─ Data summary table (descriptive stats, crosstabs)
│ ├─ Simple (few rows/columns, minimal formatting)
│ │ └─ GT() + fmt_* → ./references/quickstart.md
│ └─ Complex (conditional styling, row groups, summary rows, color scales)
│ └─ tab_style / data_color / grand_summary_rows → ./references/formatting-structure.md
├─ Frequency / cross-tabulation table
│ └─ GT() with groupname_col row-group stub → ./references/formatting-structure.md
├─ Regression / model-coefficient table
│ └─ great-tables has NO modelsummary equivalent. Use the estimator's own output:
│ pyfixest etable() (FE/DiD) or statsmodels .summary() — see those skills
└─ Table with color scales or conditional formatting
└─ data_color() or tab_style() → ./references/formatting-structure.md
Output target?
├─ HTML string (embed in a report, session workspace) → as_raw_html() → ./references/export.md
├─ HTML file on disk → write_raw_html() → ./references/export.md
├─ LaTeX (journal submission) → as_latex() → ./references/export.md
└─ PNG/PDF image → NOT available in the container (needs selenium/headless Chrome).
Export HTML instead → ./references/export.md
In DAAF research pipelines, tables are generated through script files in
scripts/stage8_analysis/, not interactively. This ensures auditability and
reproducibility.
The pattern:
scripts/stage8_analysis/{step}_{table-name}.pybash {BASE_DIR}/scripts/run_with_capture.sh {script_path}write_raw_html() (or as_raw_html() + write) to save tables into the
project output directory as HTMLSee agent_reference/SCRIPT_EXECUTION_REFERENCE.md for the mandatory file-first
execution protocol.
import polars as pl
import great_tables as gt
from great_tables import loc, style, md
tbl = (
gt.GT(df, rowname_col="region", groupname_col="group")
.tab_header(title="Revenue by Region", subtitle="FY2025")
.tab_source_note(source_note=md("Source: *synthetic data*"))
.fmt_currency(columns="revenue", currency="USD", decimals=2)
.fmt_percent(columns="share", decimals=1)
.cols_label(revenue="Revenue", share="Share")
)
html = tbl.as_raw_html()
| Operation | Code |
|---|---|
| Create table (Polars or pandas) | gt.GT(df) |
| Row-group stub | gt.GT(df, rowname_col="id", groupname_col="grp") |
| Title/subtitle | .tab_header(title=..., subtitle=...) |
| Source note | .tab_source_note(source_note=md("Source: ...")) |
| Stubhead label | .tab_stubhead(label="...") |
| Format numbers | .fmt_number(columns=..., decimals=2) |
| Format percent | .fmt_percent(columns=..., decimals=1) |
| Format currency | .fmt_currency(columns=..., currency="USD") |
| Format date | .fmt_date(columns=..., date_style=...) |
| Markdown in cells | .fmt_markdown(columns=...) |
| Column spanner | .tab_spanner(label="...", columns=[...]) |
| Grand summary rows | .grand_summary_rows(fns={"Total": pl.all().sum()}) |
| Missing-value text | .sub_missing(missing_text="--") |
| Conditional style | .tab_style(style=style.fill(color="..."), locations=loc.body(...)) |
| Color scale | .data_color(columns=[...], palette=["white", "blue"]) |
| Column labels | .cols_label(col="Label") |
| Column align | .cols_align(align="right", columns=[...]) |
| Hide columns | .cols_hide(columns=[...]) |
| Merge columns | .cols_merge(columns=["lo","hi"], pattern="{0}–{1}") |
| Column width | .cols_width({"col": "150px"}) |
| Export HTML string | .as_raw_html() |
| Write HTML file | .write_raw_html("table.html") |
| Export LaTeX | .as_latex() |
from great_tables import vals
vals.fmt_number([1234.5, 6789.0], decimals=1) # ['1,234.5', '6,789.0']
| Topic | Reference File |
|---|---|
| GT() from Polars/pandas | ./references/quickstart.md |
| tab_header, tab_source_note, tab_stubhead | ./references/quickstart.md |
| Basic fmt_number / fmt_percent / fmt_currency | ./references/quickstart.md |
| cols_label column renaming | ./references/quickstart.md |
| Full fmt_* family (date, markdown, integer, scientific, bytes) | ./references/formatting-structure.md |
| Conditional styling (tab_style, loc, style) | ./references/formatting-structure.md |
| Color scales (data_color) | ./references/formatting-structure.md |
| Column spanners (tab_spanner) | ./references/formatting-structure.md |
| Row-group stub (groupname_col, row_group_order) | ./references/formatting-structure.md |
| Grand summary rows (Polars expressions) | ./references/formatting-structure.md |
| sub_missing / sub_zero | ./references/formatting-structure.md |
| Column operations (align, hide, move, merge, width) | ./references/formatting-structure.md |
| Table options (opt_*, tab_options) | ./references/formatting-structure.md |
| as_raw_html / write_raw_html | ./references/export.md |
| as_latex | ./references/export.md |
| save() image limitation (selenium) | ./references/export.md |
| Saving into project outputs | ./references/export.md |
When great-tables is used as a primary table-formatting tool, include in the report's Software & Tools references:
Iannone, R., & Chow, M. (2024). great-tables: Easily generate information-rich, publication-quality tables from Python. Python package version 0.21.0. https://posit-dev.github.io/great-tables/
Cite when: great-tables produces tables included in the report or deliverables. Do not cite when: only used for quick exploratory tables not included in deliverables.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Guide for creating DAAF agent definition files. Covers 12-section template, hook registration, skills-in-frontmatter, integration checklist. Use when adding or revising agents. For SKILL.md files, use skill-authoring instead.
中文简介正在准备中。当前显示原文说明。
Researcher-facing analytic triangulation ("creative verification") for stress-testing provisional findings and designing pre-specified challenges before an analysis runs. Turns a researcher's concern or focal claim into competing explanations, bounded discriminating tests, audited diagnostic artifacts, and evidence-calibrated interpretations in a hypothesis/evidence ledger — behavioral, output-level verification replacing line-by-line code review. Covers 12 challenge families organized by Shadish-Cook-Campbell validity type, named sensitivity statistics, pre-committed interpretation rules, anti-fishing guardrails, and interactive diagnostic-artifact QA. Use in Ad Hoc Collaboration to verify, challenge, or stress-test a result, or to design discriminating tests before an analysis runs. Not code-change verification (verify skill / code review) and not final adjudication or re-execution (data-verifier, Reproducibility Verification) — prospective, hypothesis-driven challenge design of analytic claims.
中文简介正在准备中。当前显示原文说明。
In-situ smoke testing that verifies a LIVE DAAF deployment functions end-to-end in whatever provider route it is configured for. Auto-detects the active install route (anthropic-subscription, openrouter, chatgpt-subscription shim, openai-api shim) and runs tiered probes: Tier 0 free preflight (route/env coherence, hooks, statuslines, shim health); Tier 1 one live round-trip (~cents); Tier 2 a six-probe functional battery (dispatch, coding, web, skill loading, isolation-strip, nested-dispatch deny); Tier D a zero-cost deterministic battery (bats, Pester, lint, safety-hook tests). Use after install, after a rebuild or update, after any provider/config change (new API key, model remap, shim change), for pre-release validation, or when asked "is my install working" or to "smoke test the deployment/config." Requires the DAAF_DEV=1 dev image; a contributor tool, not end-user-facing. NOT DAAFBench (model behavioral-adherence evaluation under benchmarks/) and NOT scripts/smoke_tests/ (R/Python library-package smoke tests).
中文简介正在准备中。当前显示原文说明。
Operational framework for the DAAF orchestrator. Defines engagement modes, confirmation protocol, subagent dispatch, context budget, and reference-loading. Loaded exclusively by the orchestrator — not for subagents or user questions.
中文简介正在准备中。当前显示原文说明。
Data science methodology and method-selection routing for quantitative research. Covers EDA, data validation, descriptive analysis, causal inference (IV, DiD, RD, synthetic control), clustering/PCA/UMAP, supervised ML, geospatial analysis, network analysis, and visualization design. Contains the canonical method-to-library routing tree, routed by execution language — Python: statsmodels (OLS/GLM/time series), pyfixest (FE/DiD), linearmodels (RE/GMM/SUR), svy (complex surveys), scikit-learn (clustering/prediction ML), geopandas (spatial), igraph (network analysis); R: r-stats (OLS/GLM/time series), fixest (FE/DiD), plm (panel/RE/IV), survey-r (complex surveys), tidymodels (ML), sf-terra (spatial), igraph-r (network analysis). Load the routed tool-specific skill before giving tool-specific advice or writing code — library skills encode environment constraints and curated caveats absent from general knowledge.
中文简介正在准备中。当前显示原文说明。
Interpretation guidance for Urban Institute Education Data Portal datasets. The Portal is a curation layer over federal data: lowercase variable names, integer-encoded categoricals, standardized missing codes (-1 missing, -2 not applicable, -3 suppressed). Covers year definitions, grade encoding (grade=-1 is Pre-K, not missing), suppression rates, ODC-By licensing, and cross-source join identifiers. Load before analyzing any Portal data. Routes to source-specific deep-dive skills for individual datasets.
中文简介正在准备中。当前显示原文说明。