NameError: name 'reduce' is not defined in Python
Or if you use the six library
from six.moves import reduce
You can add
from functools import reduce
before you use the reduce.
It was moved to functools
.
Or if you use the six library
from six.moves import reduce
You can add
from functools import reduce
before you use the reduce.
It was moved to functools
.