Giter Club home page Giter Club logo

Comments (14)

Alalalalaki avatar Alalalalaki commented on May 26, 2024

There is no error for me running this code. Can you offer some more information?

What do your mean by "this particular number"?

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

This statsDataId number as well as other numbers brings up this error while other numbers work fine.

from jpstat.

Alalalalaki avatar Alalalalaki commented on May 26, 2024

Again this "0003443407" works for me. Can your provide "other numbers" that create this error?

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

Well so far all the numbers under the National Survey of Family Income, Consumption and Wealth haven't worked like 0003443428, 0003443450.

I was able to get data from Machinery Orders without any problems. For Labour Force Survey some work, some don't.

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

If this helps, this is the full error message

df[cat['@name']] = df[col_name].map(cat_map)
KeyError: '@name

from jpstat.

Alalalalaki avatar Alalalalaki commented on May 26, 2024

Ok now I find that this problem is due to some difference in the data structure when setting language to English.

A quick fix is to use lang=J. I may find some time this weekend to fix this bug for this case.

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

Yes, this fixed the problem. Thank you!
Look forward to the bug being fixed. Thanks!

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

The solution of changing the language to Japanese has now caused this error:

note = pd.DataFrame(data['STATISTICAL_DATA']['DATA_INF']['NOTE'])
                                 ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'NOTE'

from jpstat.

Alalalalaki avatar Alalalalaki commented on May 26, 2024

Can you tell me the statsDataId that you are trying to access? It seems that this dataset has a different structure comparing to others.

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

My apologies. I made a mistake. I forgot that the English sets have different IDs than Japanese sets. I was trying an English ID number with the Japanese language.

But I can't get access to all the datasets in the English version.

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

Well actually, maybe I have that incorrect. I am doing the following:

listt = jpstat.estat.get_list(statsCode="00100406")

listt @id STAT_NAME GOV_ORG STATISTICS_NAME TITLE SURVEY_DATE OPEN_DATE OVERALL_TOTAL_NUMBER 0 0003446461 景気動向指数 内閣府 景気動向指数 長期系列 0 2023-04-27 5856 1 0003446462 景気動向指数 内閣府 景気動向指数 個別系列の数値 0 2023-04-27 18482 2 0003446463 景気動向指数 内閣府 景気動向指数 個別系列の寄与度 0 2023-04-27 14647

data, note = jpstat.estat.get_data(statsDataId="0003446461")

note = pd.DataFrame(data['STATISTICAL_DATA']['DATA_INF']['NOTE']) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ KeyError: 'NOTE'

from jpstat.

Alalalalaki avatar Alalalalaki commented on May 26, 2024

You can try data = jpstat.estat.get_data(statsDataId="0003446461", return_note=False).

Each time you see there is an Error with Note you can simply suppress outputting note.

from jpstat.

Alalalalaki avatar Alalalalaki commented on May 26, 2024

I also fix the problem with lang="E" in the new version. Please update through pip and see if there is still any problems.

from jpstat.

illmattic-1 avatar illmattic-1 commented on May 26, 2024

Thanks! I upgraded the package and now English is working with this return_note=False argument. Thanks again!

from jpstat.

Related Issues (1)

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.