Giter Site home page Giter Site logo

Comments (7)

albertandking avatar albertandking commented on May 21, 2024

预测值:国际不同金融机构针对不同类型数据会展开独立的预期调查,金十数据发布的数据预期值通常引自路透社;

这个预测值是单个机构预测的,不具备普适性,所以没有计划获取预测值的数据

from akshare.

edwardsun avatar edwardsun commented on May 21, 2024

请问有没有可能做成默认=cpi历史值,但如果加参数就可以同时抓取预测值?

from akshare.

albertandking avatar albertandking commented on May 21, 2024

请问有没有可能做成默认=cpi历史值,但如果加参数就可以同时抓取预测值?

因为很多其他类似的接口没用预测值,批量修改不显示,建议您在使用的时候修改下源码部分获取

from akshare.

edwardsun avatar edwardsun commented on May 21, 2024

谢谢。有没有什么参考?

from akshare.

albertandking avatar albertandking commented on May 21, 2024

def macro_china_cpi_yearly():
"""
**年度CPI数据, 数据区间从19860201-至今
https://datacenter.jin10.com/reportType/dc_chinese_cpi_yoy
:return: pandas.Series
"""
t = time.time()
res = requests.get(
JS_CHINA_CPI_YEARLY_URL.format(
str(int(round(t * 1000))), str(int(round(t * 1000)) + 90)
)
)
json_data = json.loads(res.text[res.text.find("{") : res.text.rfind("}") + 1])
date_list = [item["date"] for item in json_data["list"]]
value_list = [item["datas"]["**CPI年率报告"] for item in json_data["list"]]
value_df = pd.DataFrame(value_list)
value_df.columns = json_data["kinds"]
value_df.index = pd.to_datetime(date_list)
temp_df = value_df["今值(%)"] # just fix 今值(%) --> 预测值(%)
temp_df.name = "cpi"
return temp_df

from akshare.

albertandking avatar albertandking commented on May 21, 2024

just fix 今值(%) --> 预测值(%)

from akshare.

edwardsun avatar edwardsun commented on May 21, 2024

thanks!

from akshare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.