加载中...
国家统计局年度分行业能源消费总量,能源折标准煤合计及 9 种能源品种在 50 多个行业的全年消费量,2000 年起,保留历史修订版本
SELECT date, report_date, energy_code, energy_name, industry_code, industry_name, parent_industry_codeFROM cn_macro_energy_consumption_industry_yearlyWHERE date >= '2026-11-04'ORDER BY dateLIMIT 1009 个字段
本表记录国家统计局发布的年度分行业能源消费总量,一年的一种能源品种在一个行业一行,只有全年消费总量一个数值。
覆盖 10 种能源品种(折标准煤的能源合计,以及煤炭、焦炭、原油、汽油、煤油、柴油、燃料油、天然气、电力)和 50 多个行业,行业从农林牧渔、工业、建筑业到居民生活,工业下又分采矿业、制造业的 30 多个门类和电力热力燃气及水生产供应业。
保留历史修订版本:同一年的数据被修订后新增一行,旧行保留,可以按 date 取任意时点当时已知的值。
全国分品种的消费量见 cn_macro_energy_consumption_yearly,分品种的平衡表见 cn_macro_energy_balance_yearly。
{{data_start_date}};数据最新年份:{{data_end_date}}。各品种和行业的起止年份见“取值”一节| 关键字 | 释意 |
|---|---|
| date | 公布日期,本表首次抓到该版本数据的日期,不是统计局公告日期 |
| report_date | 报告期,取当年 12 月 31 日,如 2023-12-31 表示 2023 年 |
| energy_code | 能源品种代码 |
| industry_code | 行业代码 |
| 字段 | 释意 |
|---|---|
| date | 公布日期;上线前的历史年份按报告期末日后 330 天估算,年份被修订后新增一行,date 为抓到修订数据的日期 |
| report_date | 报告期,取当年 12 月 31 日 |
| energy_code | 能源品种代码,energy 是折算为标准煤的能源合计 |
| energy_name | 能源品种名称,国家统计局口径 |
| industry_code | 行业代码,total 是各部门和居民生活的合计 |
| industry_name | 行业名称,国家统计局口径,合计记为“合计” |
| parent_industry_code | 上一级行业代码,合计没有上一级,为空 |
| unit | value 的计量单位,每种能源品种固定一个 |
| value | 全年消费总量,单位见 unit |
| energy_code | 名称 | 单位 | 起止年份 |
|---|---|---|---|
| energy | 能源 | 万吨标准煤 | 2000-2025 |
| coal | 煤炭 | 万吨 | 2000-2023 |
| coke | 焦炭 | 万吨 | 2000-2023 |
| crude_oil | 原油 | 万吨 | 2000-2023 |
| gasoline | 汽油 | 万吨 | 2000-2023 |
| kerosene | 煤油 | 万吨 | 2000-2023 |
| diesel | 柴油 | 万吨 | 2000-2023 |
| fuel_oil | 燃料油 | 万吨 | 2000-2023 |
| natural_gas | 天然气 | 亿立方米 | 2000-2023 |
| electricity | 电力 | 亿千瓦小时 | 2000-2023 |
| industry_code | 名称 | 上一级 | 起止年份 |
|---|---|---|---|
| total | 合计 | 无 | 2000-2025 |
| agriculture | 农、林、牧、渔业 | total | 2000-2024 |
| industry | 工业 | total | 2000-2024 |
| construction | 建筑业 | total | 2000-2024 |
| transport_storage_postal | 交通运输、仓储和邮政业 | total | 2000-2024 |
| wholesale_retail_hospitality | 批发和零售业、住宿和餐饮业 | total | 2000-2023 |
| other | 其他 | total | 2000-2024 |
| residential | 居民生活 | total | 2000-2024 |
| mining | 采矿业 | industry | 2000-2023 |
| coal_mining | 煤炭开采和洗选业 | mining | 2000-2023 |
| oil_gas_extraction | 石油和天然气开采业 | mining | 2000-2023 |
| ferrous_metal_mining | 黑色金属矿采选业 | mining | 2000-2023 |
| nonferrous_metal_mining | 有色金属矿采选业 | mining | 2000-2023 |
| nonmetal_mining | 非金属矿采选业 | mining | 2000-2023 |
| mining_support | 开采专业及辅助性活动 | mining | 2012-2023 |
| other_mining | 其他采矿业 | mining | 2000-2023 |
| manufacturing | 制造业 | industry | 2000-2023 |
| agri_food_processing | 农副食品加工业 | manufacturing | 2000-2023 |
| food_manufacturing | 食品制造业 | manufacturing | 2000-2023 |
| beverage_tea | 酒、饮料和精制茶制造业 | manufacturing | 2000-2023 |
| tobacco | 烟草制品业 | manufacturing | 2000-2023 |
| textile | 纺织业 | manufacturing | 2000-2023 |
| textile_apparel | 纺织服装、服饰业 | manufacturing | 2000-2023 |
| leather_footwear | 皮革、毛皮、羽毛及其制品和制鞋业 | manufacturing | 2000-2023 |
| wood_products | 木材加工及木、竹、藤、棕、草制品业 | manufacturing | 2000-2023 |
| furniture | 家具制造业 | manufacturing | 2000-2023 |
| paper | 造纸及纸制品业 | manufacturing | 2000-2023 |
| printing | 印刷和记录媒介复制业 | manufacturing | 2000-2023 |
| culture_sports_goods | 文教、工美、体育和娱乐用品制造业 | manufacturing | 2000-2023 |
| petroleum_coal_fuel_processing | 石油、煤炭及其他燃料加工业 | manufacturing | 2000-2023 |
| chemicals | 化学原料及化学制品制造业 | manufacturing | 2000-2023 |
| pharmaceuticals | 医药制造业 | manufacturing | 2000-2023 |
| chemical_fiber | 化学纤维制造业 | manufacturing | 2000-2023 |
| rubber_plastic | 橡胶和塑料制品业 | manufacturing | 2000-2023 |
| rubber_products | 橡胶制品业 | rubber_plastic | 2000-2011 |
| plastic_products | 塑料制品业 | rubber_plastic | 2000-2011 |
| nonmetal_mineral_products | 非金属矿物制品业 | manufacturing | 2000-2023 |
| ferrous_smelting | 黑色金属冶炼及压延加工业 | manufacturing | 2000-2023 |
| nonferrous_smelting | 有色金属冶炼及压延加工业 | manufacturing | 2000-2023 |
| metal_products | 金属制品业 | manufacturing | 2000-2023 |
| general_equipment | 通用设备制造业 | manufacturing | 2000-2023 |
| special_equipment | 专用设备制造业 | manufacturing | 2000-2023 |
| automobile | 汽车制造业 | manufacturing | 2000-2023 |
| other_transport_equipment | 铁路、船舶、航空航天和其他运输设备制造业 | manufacturing | 2012-2023 |
| electrical_machinery | 电气机械及器材制造业 | manufacturing | 2000-2023 |
| electronics | 计算机、通信和其他电子设备制造业 | manufacturing | 2000-2023 |
| instruments | 仪器仪表制造业 | manufacturing | 2000-2023 |
| other_manufacturing | 其他制造业 | manufacturing | 2000-2023 |
| waste_recycling | 废弃资源综合利用业 | manufacturing | 2000-2023 |
| equipment_repair | 金属制品、机械和设备修理业 | manufacturing | 2012-2023 |
| utilities | 电力、热力、燃气及水生产和供应业 | industry | 2000-2023 |
| power_heat_supply | 电力、热力的生产和供应业 | utilities | 2000-2023 |
| gas_supply | 燃气生产和供应业 | utilities | 2000-2023 |
| water_supply | 水的生产和供应业 | utilities | 2000-2023 |
energy。parent_industry_code 找上一级。
汇总时只取同一层级,不要把上级和下级一起加。full_db_scan=True,各年份取最新版本:from bigquant import dai
sql = """SELECT report_date, energy_code, industry_code, valueFROM cn_macro_energy_consumption_industry_yearlyWHERE industry_code IN ('industry', 'manufacturing', 'mining') AND energy_code = 'coal'QUALIFY row_number() OVER (PARTITION BY report_date, energy_code, industry_code ORDER BY date DESC) = 1ORDER BY report_date, industry_code"""df = dai.query(sql, full_db_scan=True).pl()sql = """SELECT report_date, energy_code, industry_code, valueFROM cn_macro_energy_consumption_industry_yearlyWHERE date <= '2024-06-28' AND report_date >= '2015-01-01' AND industry_code = 'industry'QUALIFY row_number() OVER (PARTITION BY report_date, energy_code, industry_code ORDER BY date DESC) = 1ORDER BY report_date, energy_code"""df = dai.query(sql, full_db_scan=True).pl()国家统计局的数据接口不提供公布时间,公告表 cn_macro_announcement 里也没有这批能源数据的公告,所以 date 是本表自己记的版本日期。
统计局发布各指标年度数据的实际时间没有逐个核实,date 取偏晚的估算值,不会引入未来信息:
date 取抓取当天与“报告期末日后 330 天”中较早的一个,所以刚发布的数据 date 就是抓到的当天;已入库年份的数值发生变化即视为修订,新增一行,date 记抓取当天,更早年份的修订通过不定期的全量历史构建补入。上线前的历史只保留一个版本,取值是上线时的最新值。
数据源页面的更新记录里,增量和历史写入的说明是一句话:[增量] 或 [历史] 开头,写明本次写入的报告期范围和行数。
修复用于改正已入库的数据:只处理指定日期所在的年份,被改正的行沿用原来的公布日期 date,按主键覆盖旧值,不新增版本;更新记录里的说明是调用方传入的 update_note 原文。
仓库里没有这批数据的旧表,本表是新增数据。
SELECT date, report_date, energy_code, energy_name, industry_code, industry_name, parent_industry_codeFROM cn_macro_energy_consumption_industry_yearlyWHERE date >= '2026-11-04'ORDER BY dateLIMIT 100