一键导入
officeqa-compute
Python one-liner recipes for common Treasury Bulletin calculations — stdev, regression, pct change, CAGR, etc.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Python one-liner recipes for common Treasury Bulletin calculations — stdev, regression, pct change, CAGR, etc.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review board — verify the analyst's answer before final submission
Python computation formulas for Treasury data analysis. Use for percent change, CAGR, stdev, kurtosis, VaR, regression, Theil index, and other statistical calculations.
CPI-U annual averages (1929-2024) for inflation adjustment. Use when question mentions inflation, CPI, constant dollars, or real dollars.
How to read Treasury Bulletin data files in /app/resources/. Use when exploring resources or when JSON parsing fails.
U.S. fiscal year boundaries and calendar year conversions. Use when question mentions fiscal year, FY, or when you need to determine which months belong to a fiscal year.
How to accurately extract values from Treasury Bulletin tables. Use when reading tables with many columns, similar row labels, or when you need to verify you have the right cell.
| name | officeqa-compute |
| description | Python one-liner recipes for common Treasury Bulletin calculations — stdev, regression, pct change, CAGR, etc. |
All recipes use python3 -c with extracted values. Replace [...] with your actual numbers.
Sum monthly values: extract 12 months → python3 -c "print(sum([v1,...,v12]))"
Pct change: extract old, new → python3 -c "print((NEW-OLD)/OLD*100)"
Stdev (sample): extract N values → python3 -c "import statistics; print(statistics.stdev([...]))"
Stdev (population): → statistics.pstdev([...])
Geometric mean: N positive values → statistics.geometric_mean([...])
Regression: paired (x,y) → r=statistics.linear_regression(xs,ys); print(r.slope,r.intercept)
Correlation: → statistics.correlation(xs,ys)
Theil index: N values → import math; v=[...]; m=sum(v)/len(v); print(sum((x/m)*math.log(x/m) for x in v)/len(v))
Z-score: series + target → print((TARGET-statistics.mean(v))/statistics.stdev(v))
Expected shortfall 95%: → v=sorted([...]); c=max(1,int(len(v)*0.05)); print(sum(v[:c])/c)
CAGR: start,end,years → print(((END/START)**(1/YEARS)-1)*100)
Compounded growth: → import math; print(math.log(END/START)/YEARS)
python3 -c "
x=YOUR_RAW_VALUE; n=DECIMAL_PLACES
print(f'raw={x}')
print(f'rounded={round(x,n)}')
print(f'truncated={int(x*10**n)/10**n}')
"
If rounded and truncated differ, prefer truncated — Treasury legacy systems use fixed-point truncation.