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

File "pandas/_libs/hashtable_class_helper.pxi", line 993, in pandas._libs.hashtable.Int64HashTable.get_item KeyError: 31 #2

Open
Jeriousman opened this issue Feb 26, 2021 · 0 comments

Comments

@Jeriousman
Copy link

In your main_knn file,

when I'm running the code below, I get an error. Can you share how to fix it? Thank you.

HG = dgl.heterograph({
('user', 'um', 'movie'): (ratings_train['user_idx'], ratings_train['movie_idx']),
('movie', 'mu', 'user'): (ratings_train['movie_idx'], ratings_train['user_idx'])})

error:

Traceback (most recent call last):

File "", line 3, in
('movie', 'mu', 'user'): (ratings_train['movie_idx'], ratings_train['user_idx'])})

File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/dgl/convert.py", line 309, in heterograph
u, v, urange, vrange = utils.graphdata2tensors(data, idtype, bipartite=is_bipartite)

File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/dgl/utils/data.py", line 147, in graphdata2tensors
data = F.tensor(data[0]), F.tensor(data[1])

File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/dgl/backend/pytorch/tensor.py", line 40, in tensor
return th.as_tensor(data, dtype=dtype)

File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/pandas/core/series.py", line 868, in getitem
result = self.index.get_value(self, key)

File "/home/hojun/anaconda3/envs/ai/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4375, in get_value
tz=getattr(series.dtype, 'tz', None))

File "pandas/_libs/index.pyx", line 81, in pandas._libs.index.IndexEngine.get_value

File "pandas/_libs/index.pyx", line 89, in pandas._libs.index.IndexEngine.get_value

File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc

File "pandas/_libs/hashtable_class_helper.pxi", line 987, in pandas._libs.hashtable.Int64HashTable.get_item

File "pandas/_libs/hashtable_class_helper.pxi", line 993, in pandas._libs.hashtable.Int64HashTable.get_item

KeyError: 31

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

1 participant