Join the conversation
import numpy as np
from scipy.stats import chi2_contingency# Create a 2x2 contingency table
observed = np.array([[30, 10], [20, 25]])# Perform the chi-square test
chi2, p_value, dof, expected = chi2_contingency(observed)# Print the results
print(f"Chi-square statistic: {chi2}")
print(f"P-value: {p_value}")
print(f"Degrees of freedom: {dof}")
print("Expected frequencies:")
print(expected)
Reply
bhai ap ye tests kesa perform kar raha hoo. kahan se tutorial mila tests ka
Python ka Chilla 29% Completed
please allow me to join AI with Data Science Course
Reply
It's really helpful😚😚
Reply