Skip to content

新增工业企业月度利润数据集 + 数据集文档拆分 #35

@hilr

Description

@hilr

背景

/mnt/readonly_dataset/gov_stats/工业企业指标/ 存放了 2000–2026 年规模以上工业企业经济效益月度数据,其中 利润总额累计值(亿元)累计值且每年 1 月恒为空。需要一个新数据集把累计值差分为每月当月利润总额。同时,数据集越来越多,README 中内联的文档变得臃肿,需要拆分。

改动

1. 新增数据集 gov_stat/industry_profit

  • quant/convert.py 新增 convert_industry_profit(data_path, output_dir) -> int,把累计值按统一规则差分为月度值
  • quant/cli.py 新增 industry-profit 命令
  • 输出:{output_dir}/gov_stat/industry_profit/{year}.csv,每年一个文件(2000–2026 共 27 个)
  • Schema:year (int), month (int), profit (float, 亿元)
  • 零新依赖(XLSX 用 stdlib zipfile+ElementTree 解析)

计算口径:相邻已知累计点之间均摊差额

  • gap=1(满数据年 2000–2006、2010–2025):精确差分
  • gap=2(每年 1–2 月):1、2 月各 = cum[2]/2
  • gap=3(仅 2007–2009 的 3–11 月):等额估计值
  • 无上界的月份(2007–2009 的 12 月、2026 的 5–12 月):空

2010 重建:2010 自身只有 2/5/8/11 月且为旧口径,改用 2011 文件的「利润总额上年同期累计值」列(完整 2–12 月 = 2010 同月累计,新口径重述值)重建,与 2011+ 连续可比。

2. 数据集文档拆分

  • 新建 docs/datasets/ 目录,10 个原始/生成数据集各一个 md 文件
  • README 改为索引(数据集索引表 + 链接到每个文件)
  • 每个文档顶部有 [← 数据集索引] 反向链接

验证

  • 2023(精确):1/2月 = 8872.10/2 = 4436.05;3月 = 15167.40−8872.10 = 6295.30 ✓
  • 2010(重建):12 个月全有值;1/2月 = 4806.71/2 = 2403.355 ✓
  • 2007(等额估计):1/2月 = 2932.07/2 = 1466.035;3/4/5月各 = (9025.99−2932.07)/3 = 2031.31;12月空 ✓
  • 2026:1–4月有值、5–12月空 ✓
  • 27 个 CSV 共 324 行(27×12),313 非空,空值分布与口径规则吻合

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions