TypeError: cannot unpack non-iterable int objec
Just replace return 0 by return 0, 0, or better: raise an error instead of returning 0 When your if condition is True, you only return 0. Then later, when you do agg, gps = get_grps(…), you tell python to unpack the result of the function. Then, python is expecting a 2-length iterable, and try to unpack it, but as it says: … Read more