You can perform either a Fisher exact test or Chi-square test to calculate p-value. For chi-square, you need to perform Chi-square test. Scipy library has functions for both of these tests.Fisher exact test on a 2x2 contingency table
>>> obsarray([[60, 14], [19, 80]])>>> from scipy.stats import fisher_exact>>> oddsratio, pvalue = fisher_exact(obs)>>> pvalue1.4292844716515043e-16>>> oddsratio18.045112781954888
Chi-square test of independence of variables in a contingency table.
>>> obsarray([[60, 14], [19, 80]])>>> chi, pvalue, dof, ex = chi2_contingency(obs)>>> chi62.900798319007976>>> pvalue2.1738410013620548e-15>>> dof1L>>>