Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Getting this error while running dash

C:\Users\Avinash>python avinash1.py

  • Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
    [2017-11-24 20:40:59,702] ERROR in app: Exception on /_dash-update-component [POST]
    Traceback (most recent call last):

File “pandas_libs\hashtable_class_helper.pxi”, line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'gdgpercap

@akuma308 - Could you paste the entire code snippet that you are running? It looks like this is an error with your code, in particular it looks like gdgpercap isn’t a column in a dataframe that you are referencing.

C:\Users\Avinash>python avinash1.py

  • Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
    127.0.0.1 - - [24/Nov/2017 20:40:57] “GET / HTTP/1.1” 200 -
    127.0.0.1 - - [24/Nov/2017 20:40:59] “GET /_dash-layout HTTP/1.1” 200 -
    127.0.0.1 - - [24/Nov/2017 20:40:59] “GET /_dash-dependencies HTTP/1.1” 200 -
    [2017-11-24 20:40:59,702] ERROR in app: Exception on /_dash-update-component [POST]
    Traceback (most recent call last):
    File “c:\users\avinash\appdata\local\programs\python\python36-32\lib\site-packages\pandas\core\indexes\base.py”, line 2522, in get_loc
    return self._engine.get_loc(key)
    File “pandas_libs\index.pyx”, line 117, in pandas._libs.index.IndexEngine.get_loc
    File “pandas_libs\index.pyx”, line 139, in pandas._libs.index.IndexEngine.get_loc
    File “pandas_libs\hashtable_class_helper.pxi”, line 1265, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File “pandas_libs\hashtable_class_helper.pxi”, line 1273, in pandas._libs.hashtable.PyObjectHashTable.get_item
    KeyError: ‘gdgpercap’

@akuma308 - Could you paste the entire code inside avinash1.py, not just the error message? Otherwise, we have no way to tell what’s going wrong.