Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does the parameter 'h' mean in the Request? #5

Open
fengyj opened this issue Jun 17, 2024 · 0 comments
Open

What does the parameter 'h' mean in the Request? #5

fengyj opened this issue Jun 17, 2024 · 0 comments

Comments

@fengyj
Copy link

fengyj commented Jun 17, 2024

我在执行该code的时候,返回的数据不对。

result = stats(zbcode='A010102', datestr='202201', dbcode="hgyd")
print(result)

返回的数据不是查询的2022-01的数据。

[['居民消费价格指数(上年同月=100)', 'A01010201', '201512', '101.6'], ['居民消费价格指数(上年同月=100)', 'A01010201', '201511', '101.5'], ['居民消费价格指数(上年同月=100)', 'A01010201', '201510', '101.3'], ['居民消费价格指数(上年同月=100)', 'A01010201', '201509', '101.6'], ['食品类居民消费价格指数(上年同月=100)', 'A01010202', '201512', '102.7'], ['食品类居民消费价格指数(上年同月=100)', 'A01010202', '201511', '102.3'], ['食品类居民消费价格指数(上年同月=100)', 'A01010202', '201510', '101.9'], ['食品类居民消费价格指数(上年同月=100)', 'A01010202', '201509', '102.7'], ['烟酒及用品类居民消费价格指数(上年同月=100)', 'A01010203', '201512', '103.9'], ['烟酒及用品类居民消费价格指数(上年同月=100)', 'A01010203', '201511', '103.8'], ['烟酒及用品类居民消费价格指数(上年同月=100)', 'A01010203', '201510', '103.8'], ['烟酒及用品类居民消费价格指数(上年同月=100)', 'A01010203', '201509', '103.8'], ['衣着类居民消费价格指数(上年同月=100)', 'A01010204', '201512', '102.0'], ['衣着类居民消费价格指数(上年同月=100)', 'A01010204', '201511', '102.2'], ['衣着类居民消费价格指数(上年同月=100)', 'A01010204', '201510', '102.4'], ['衣着类居民消费价格指数(上年同月=100)', 'A01010204', '201509', '102.8'], ['家庭设备用品及维修服务类居民消费价格指数(上年同月=100)', 'A01010205', '201512', '100.8'], ['家庭设备用品及维修服务类居民消费价格指数(上年同月=100)', 'A01010205', '201511', '100.8'], ['家庭设备用品及维修服务类居民消费价格指数(上年同月=100)', 'A01010205', '201510', '100.8'], ['家庭设备用品及维修服务类居民消费价格指数(上年同月=100)', 'A01010205', '201509', '101.0'], ['医疗保健和个人用品类居民消费价格指数(上年同月=100)', 'A01010206', '201512', '102.5'], ['医疗保健和个人用品类居民消费价格指数(上年同月=100)', 'A01010206', '201511', '102.6'], ['医疗保健和个人用品类居民消费价格指数(上年同月=100)', 'A01010206', '201510', '102.2'], ['医疗保健和个人用品类居民消费价格指数(上年同月=100)', 'A01010206', '201509', '102.1'], ['交通和通讯类居民消费价格指数(上年同月=100)', 'A01010207', '201512', '98.7'], ['交通和通讯类居民消费价格指数(上年同月=100)', 'A01010207', '201511', '98.6'], ['交通和通讯类居民消费价格指数(上年同月=100)', 'A01010207', '201510', '98.1'], ['交通和通讯类居民消费价格指数(上年同月=100)', 'A01010207', '201509', '97.9'], ['娱乐教育文化用品及服务类居民消费价格指数(上年同月=100)', 'A01010208', '201512', '101.3'], ['娱乐教育文化用品及服务类居民消费价格指数(上年同月=100)', 'A01010208', '201511', '101.2'], ['娱乐教育文化用品及服务类居民消费价格指数(上年同月=100)', 'A01010208', '201510', '101.1'], ['娱乐教育文化用品及服务类居民消费价格指数(上年同月=100)', 'A01010208', '201509', '101.4'], ['居住类居民消费价格指数(上年同月=100)', 'A01010209', '201512', '100.8'], ['居住类居民消费价格指数(上年同月=100)', 'A01010209', '201511', '100.7'], ['居住类居民消费价格指数(上年同月=100)', 'A01010209', '201510', '100.6'], ['居住类居民消费价格指数(上年同月=100)', 'A01010209', '201509', '100.8']]

上面代码应该是执行的该查询。
https://data.stats.gov.cn/easyquery.htm?m=QueryData&dbcode=hgyd&rowcode=zb&h=1&colcode=sj&wds=[]&dfwds=[{%22wdcode%22:%22zb%22,%22valuecode%22:%22A010102%22},{%22wdcode%22:%22sj%22,%22valuecode%22:%22202201%22}]
当去掉参数h后,返回的数据应该是对的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant