0

My task is to run a script on another machine. I have set up a conda environment: Python3.6 Pandas1.0.3

The system: Ubuntu 16.04.6 Xenial

So far I just had to adjust Python2 to Python3 code in the script, but now I am stuck with the following:

losses = pd.DataFrame([sum(step, []) for step in losses], colums=['Frechet Distance GAN1', 'Frechet Distance GAN2', ....]) 

I get the following error:

TypeError: can only concatenate list (not "str") to list

I am pretty sure the villain is (sum(step, []) or some kind of Python2 to Python3 issue.

David Buck
  • 3,752
  • 35
  • 31
  • 35
  • What did you think the `sum` part would do? – Arya McCarthy Apr 01 '20 at 13:29
  • Honestly, I don't know for sure, I would guess it is a way to concatenate two lists in Python as described here: https://stackoverflow.com/a/56407963/13182022. – Smajohan Apr 01 '20 at 16:09
  • As I mentioned the code was executable and running on another machine maybe with older versions of the respective packages – Smajohan Apr 01 '20 at 16:13
  • Somehow I doubt that `step` is a list, so this won't work. But you should really expand the code that you've shown into a [mcve]. – Arya McCarthy Apr 01 '20 at 17:33

0 Answers0