Open b0b3rt opened 7 years ago
Refer to this: https://stackoverflow.com/questions/43663206/typeerror-unsupported-operand-types-for-dict-values-and-int
Simply convert self.w.values()
to list before the sum will do the trick. (i.e. list(self.w.values())
)
Code requires: from functools import reduce #py2.7 reduce > py3.x functools.reduce s/xrange/range #py2.7 xrange > py3.x range
Issue after those are fixed: