In [1]:
import numpy as np
import pandas as pd
In [2]:
CS=pd.read_excel("F:/2019 GB Python/ChiS.xlsx")
In [3]:
CS.head()
Out[3]:
Client Result
0 Client A Corrections
1 Client A Corrections
2 Client A Corrections
3 Client A Corrections
4 Client A Corrections
In [4]:
from scipy.stats import chisquare,chi2_contingency
In [5]:
CR= pd.crosstab(CS['Client'], CS['Result'])
In [6]:
CR
Out[6]:
Result Corrections No Issues
Client
Client A 12 39
Client B 76 98
In [7]:
chi2_contingency(CR)
Out[7]:
(5.9040322183091485,
 0.015106263154280606,
 1,
 array([[ 19.94666667,  31.05333333],
        [ 68.05333333, 105.94666667]]))
In [ ]: