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

cui2vec-converter.py showing error #4

Closed
anaymalpani opened this issue May 30, 2019 · 6 comments
Closed

cui2vec-converter.py showing error #4

anaymalpani opened this issue May 30, 2019 · 6 comments

Comments

@anaymalpani
Copy link

Traceback (most recent call last):
File "/home/adwait/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2657, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'CUI'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./cui2vec-converter.py", line 7, in
cui_vecs_df.set_index('CUI', inplace=True)
File "/home/adwait/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 4178, in set_index
level = frame[col]._values
File "/home/adwait/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 2927, in getitem
indexer = self.columns.get_loc(key)
File "/home/adwait/.local/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2659, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'CUI'
error

@Pancham97
Copy link

I am facing the same issue. I guess this is because the cui2vec-pretrained.csv does not have any CUI column name.

@gliitterpuke
Copy link

Is there an update on this?

@leanderme
Copy link
Owner

I'm sorry for the late reply! @Pancham97 @anaymalpani @gliitterpuke could you have a quick look on the cui2vec-pretrained.csv file and check the column names? In case there is a typo, I apologize for this. For a quick fix, please rename the column to CUI.

@gliitterpuke
Copy link

@leanderme you're right! CUI was missing as the column name :) renamed and it ran perfectly

@AlexHodo
Copy link

AlexHodo commented Jul 9, 2019

Which column should I rename to 'CUI'?

@egealpay
Copy link

Which column should I rename to 'CUI'?

Can anyone give an answer for this question?

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

6 participants