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

Typle Error #177

Closed
lux0818 opened this issue Oct 30, 2019 · 5 comments
Closed

Typle Error #177

lux0818 opened this issue Oct 30, 2019 · 5 comments

Comments

@lux0818
Copy link

lux0818 commented Oct 30, 2019

Hello professor!thanks for your code. when I run main.py and choose the algorithm . it always has the same question:
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/新建文件夹/RecQ/RecQ-master/main/main.py", line 67, in
recSys.execute()
File "C:\Users\Administrator\Desktop\新建文件夹\RecQ\RecQ-master\main\RecQ.py", line 100, in execute
self.measure = [dict.setdafault(m)[i] for i in range(1,k+1)]
File "C:\Users\Administrator\Desktop\新建文件夹\RecQ\RecQ-master\main\RecQ.py", line 100, in
self.measure = [dict.setdafault(m)[i] for i in range(1,k+1)]
AttributeError: type object 'dict' has no attribute 'setdafault'
How can I solve it?looking for your reply.

@Coder-Yu
Copy link
Owner

Have you modified the code? The original code here is self.measure = [dict(m)[i] for i in range(1,k+1)]

@lux0818
Copy link
Author

lux0818 commented Oct 30, 2019 via email

@lux0818
Copy link
Author

lux0818 commented Oct 30, 2019 via email

@lux0818
Copy link
Author

lux0818 commented Oct 30, 2019

I have modified the code and run again.it has KeyError:
Traceback (most recent call last):
File "C:/Users/Administrator/Desktop/新建文件夹/RecQ/RecQ-master/main/main.py", line 67, in
recSys.execute()
File "C:\Users\Administrator\Desktop\新建文件夹\RecQ\RecQ-master\main\RecQ.py", line 100, in execute
self.measure = [dict(m)[i] for i in range(1,k+1)]
File "C:\Users\Administrator\Desktop\新建文件夹\RecQ\RecQ-master\main\RecQ.py", line 100, in
self.measure = [dict(m)[i] for i in range(1,k+1)]
KeyError: 1

@Coder-Yu
Copy link
Owner

I suggest you use python 2.7 without modifying the original code yourself. I will update the repository to python 3 in the next few weeks

@Coder-Yu Coder-Yu closed this as completed Jan 3, 2020
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

2 participants