GithubHelp home page GithubHelp logo

Comments (6)

SimonKitSangChu avatar SimonKitSangChu commented on May 29, 2024

Traceback (most recent call last):
File "preprocess_data.py", line 80, in
main()
File "preprocess_data.py", line 60, in main
pd_joined = fdc_dm.join_data()
File "/home/work/phd/FoodOntology/preprocess/fdc_data_manager.py", line 79, in join_data
pd_joined = self.fdc_data_dic['food'].join(
KeyError: 'food'

I encounter this KeyError when running run.sh. This should be related to one of the packages in preprocess imported in preprocess_data.py.

from love.

jasonyoun avatar jasonyoun commented on May 29, 2024

Unfortunately, I cannot reproduce that bug. The issue you are having has nothing to do with any packages being imported. If you read the code FdcDataManager._load_data(), self.fdc_data_dic is a dictionary where the key is filename and the value is the pd.DataFrame. The fact that you encountered KeyError means that 'food' was not filled up correctly in _load_data(). This means that your data directory was not setup properly.

I am very certain this has to do with you not being able to download the CSV files from FDC using ./download_fdc.sh. I highly suggest you downloading the data from FDC again, and running the script.

from love.

SimonKitSangChu avatar SimonKitSangChu commented on May 29, 2024

Thanks Jason. I have already erased the whole directory and re-run ./run.sh. The error persists.

from love.

jasonyoun avatar jasonyoun commented on May 29, 2024

Let's see the code in person. Please let me know when you'll be in the lab today.

from love.

SimonKitSangChu avatar SimonKitSangChu commented on May 29, 2024

I will be available at about 6 pm.

from love.

jasonyoun avatar jasonyoun commented on May 29, 2024

I'll see u then

from love.

Related Issues (2)

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.