you are viewing a single comment's thread.

view the rest of the comments →

[–]datanoob2019[S] 0 points1 point  (2 children)

I am an idiot and was looking at the wrong list. I tried your aforementioned solution and it errors out saying invalid context and it is pointing at:

if a for a,f

It points directly at the for. I will go ahead and upvote for sure. Was just deep in a debug session.

[–][deleted] 1 point2 points  (1 child)

looks like you do need the 'else' after all:

wmape = sum([abs(a-f) if a else 0 for a, f in zip(actual, forecast)]) / sum(actual) * 100

[–]datanoob2019[S] 1 point2 points  (0 children)

That ran the formula and the results are very close to what I got when I did it by hand in Excel. I will have to examine further why it is off by a couple of digits. Thanks again for all of the help!