In [1]:
import pandas as pd
data = {'Student': ['A', 'B', 'C', 'D'],
'Math': [90, None, 80, 85],
'Science': [85, 75, None, 90],
'English': [None, 88, 93, 87]}
df = pd.DataFrame(data)
print(df.isnull().sum())
Student 0 Math 1 Science 1 English 1 dtype: int64
In [3]:
from scipy.stats import t
# Given values
t_value = 2.45
df = 58 # degrees of freedom (n_1 + n_2 - 2)
# Calculate the two-tailed p-value
p_value = 2 * (1 - t.cdf(t_value, df))
print(f"P-value: {p_value:.4f}") #0.0173
P-value: 0.0173
In [4]:
from scipy.stats import t
# Given values
t_value = 7.18
df = 58 # degrees of freedom (n_1 + n_2 - 2)
# Calculate the two-tailed p-value
p_value = 2 * (1 - t.cdf(t_value, df))
print(f"P-value: {p_value:.4f}") #0.000
P-value: 0.0000
In [ ]:
In [ ]:
!jupyter nbconvert --to html bana320_lecture3.ipynb
[NbConvertApp] Converting notebook bana310_final.ipynb to html [NbConvertApp] WARNING | Alternative text is missing on 14 image(s). [NbConvertApp] Writing 963726 bytes to bana310_final.html