This is your problem: tuple(.123/(nodes_num - 1))
The tuple constructor takes an iterable and makes a tuple from the values it produces. Obviously, .123/(nodes_num - 1) is a float, which can't be iterated. If you want to make a one element tuple of this value, use: (.123/(nodes_num - 1),) (note: That trailing comma is necessary to make a one element tuple, otherwise the parens are just grouping the operation, not wrapping it in a tuple).
So the resulting line would be:
avg = frozenset([(.123/(nodes_num - 1),)])
That will make a len 1 frozenset containing a len 1 tuple with the calculated float value. If the goal is just a frozenset of that one value, you don't need the tuple wrapping at all, and can simplify to:
avg = frozenset([.123/(nodes_num - 1)])
Now, whether either does anything meaningful for your scenario I don't know, but it's the source of your error.