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

Running on Python 3.5+ #6

Open
lenhhoxung86 opened this issue Oct 24, 2018 · 3 comments
Open

Running on Python 3.5+ #6

lenhhoxung86 opened this issue Oct 24, 2018 · 3 comments

Comments

@lenhhoxung86
Copy link

Hello,

I run your code with Python 3.5+ and it throws several errors. I suppose it is supposed to run with Python 2.7?
Some lines that could be edited for Python 3.5+:

uid = map(lambda x: profile2id[x], tp['userId'])
sid = map(lambda x: show2id[x], tp['movieId'])

Should be:

uid = list(map(lambda x: profile2id[x], tp['userId']))
sid = list(map(lambda x: show2id[x], tp['movieId']))

idxlist = range(N) should be idxlist = np.arange(N)

@dawenl
Copy link
Owner

dawenl commented Oct 24, 2018

Yes, the code is written for Python 2.7. To make it Python 3.5+ compatible, there should be mostly minor changes involving what you have mentioned here. (Maybe dict.iteritems() to the corresponding method in Python 3.)

@karthikraja95
Copy link

@lenhhoxung86 Do you have the python 3.5+ file for this repo. If so could you share that. I am struggling to make it work on python 3.5+.

Thanks

@lizhenstat
Copy link

Yes, the code is written for Python 2.7. To make it Python 3.5+ compatible, there should be mostly minor changes involving what you have mentioned here. (Maybe dict.iteritems() to the corresponding method in Python 3.)

Hi, @dawenl , thanks for your reply. I was wondering which numpy, pandas and tensorflow version of this code? thanks a lot.

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

4 participants