When both variables are categories, such as a trial's channel and whether it converted, a chi-square test of independence asks whether the outcome depends on the group. It compares the observed counts in a table with the counts expected if there were no relationship.
In SciPy: build the table with pd.crosstab(rows, columns), then stats.chi2_contingency(table) returns the statistic, the p-value, the degrees of freedom ((rows - 1) × (columns - 1)) and the expected counts.
Check that expected counts are at least about 5; below that, the test is unreliable.
For a 2 × 2 table SciPy applies Yates' continuity correction by default. Without it (correction=False), the chi-square statistic equals the square of the two-proportion z.
Pass counts, never percentages: the test needs to know the sample size.