Python, Statistics, Data Science, Machine Learning, Statistical Analysis.
significant relationship with sex. Let’s import the chi_square function from scipy and create a cross-tab of species against sex. from scipy.stats import chi2_contingency cross_tab = pd.crosstab(index = penguins["species"], columns = penguins["sex"] cross_tab_matrix = np.array(cross_tab) )