tompollard / tableone

Create "Table 1" for research papers in Python
https://pypi.python.org/pypi/tableone/
MIT License
164 stars 41 forks source link

added welch's t-test (i think) #58

Closed jraffa closed 6 years ago

jraffa commented 6 years ago

Not sure if I'm pythoning correctly, but I think you should roughly get what I was going for

tompollard commented 6 years ago

thanks jesse. looks like group_data should be grouped_data?

tompollard commented 6 years ago

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.

tompollard commented 6 years ago

great, thanks