Closed jraffa closed 6 years ago
thanks jesse. looks like group_data
should be grouped_data
?
sorry, should have spotted this, but len(*grouped_data)
should be len(grouped_data)
. The *
unpacks the list and inputs each item to the function as a separate argument.
e.g. if x = [[1,2,3],[4,5,6]]
then f(*x)
becomes f([1,2,3],[4,5,6])
(i.e. 2 arguments, each a list).
This is useful when we don't know how many arguments to expect, for example for the stats functions, which ask for each group as a separate argument. For len
we just want to check how many groups there are, so no * is needed.
great, thanks
Not sure if I'm pythoning correctly, but I think you should roughly get what I was going for