0

I have cloned a Github project which was developed in Python 2 and run it in Python 3.6, the following line gives "syntax error".

working_docs = [map(lambda (sid, sent): (sid, [sent]), d) for d in tokenized_docs]

The value for tokenized_docs is a list of list of tuples, see the screenshot below for value inspection. Please help.

enter image description here

Zheng Xie
  • 415
  • 3
  • 13
  • 1
    error aside, this is a bad strategy, even if you don't get errors you should not just blindly run python 2 code on python 3 and *hope* it works – Chris_Rands Nov 19 '19 at 13:31
  • always put full error message (starting at word "Traceback") in question (not comment) as text (not screenshot). There are other useful information. – furas Nov 19 '19 at 13:58
  • I'm very new to Python and trying to evaluate existing projects. This line is a bit too complicated for me to grasp. I did spend time on it and couldn't make it work. Can you please convert it into python 3? thanks. – Zheng Xie Nov 19 '19 at 14:52

0 Answers0