Stat Run Code
stat_run_codeRun custom Python in the statistical session namespace to perform analyses not covered by structured tools, using preloaded Pingouin, pandas, NumPy, Matplotlib, and Seaborn; plots save automatically.
Instructions
Execute arbitrary Python against the session namespace — the escape hatch.
Use this for anything the structured tools do not cover: custom recoding, a Pingouin function not exposed as a tool, or a bespoke plot.
Pre-bound names: pg (pingouin), pd (pandas), np (numpy), plt
(matplotlib), sns (seaborn), plus every loaded object by name.
The value of a trailing expression is returned. Matplotlib figures are saved automatically and their paths returned.
WHEN TO USE: beyond the structured tools. WHEN NOT TO USE: for routine analyses — the structured tools report assumptions and effect sizes that a bare call would omit.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "stat_run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |