FunctionRacerProblemsRace

Are They Independent

MediumSciPyPython

table counts people by two answers: its rows are one question's answers and its columns the other's. Return the p-value of the chi-square test of independence between the two questions. Do not apply a continuity correction.

Example 1

table [[10,20],[20,40]]
returns 1.0

The second row is exactly twice the first, so the two answers are unrelated in this table.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More SciPy problems