textstat/resources/TextStat.py
def chi2Score(observation, expectation):
   """Returns the Chi2-score for an observation and expectation value list."""
   if len(observation) == len(expectation):
      return sum((observation[i] - max(expectation[i], CI2EXPECTATIONCOUNTOFF))**2 / max(expectation[i], CI2EXPECTATIONCOUNTOFF) for i in range(len(observation)))
   return None
Returns the Chi2-score for an observation and expectation value list.
Returns the Chi2-score for an observation and expectation value list.
Returns the Chi2 - score for an observation and expectation value list .
def chi2Score(observation, expectation):
   if len(observation) == len(expectation):
      return sum((observation[i] - max(expectation[i], CI2EXPECTATIONCOUNTOFF))**2 / max(expectation[i], CI2EXPECTATIONCOUNTOFF) for i in range(len(observation)))
   return None
def chi2Score ( observation , expectation ) : if len ( observation ) == len ( expectation ) : return sum ( ( observation [ i ] - max ( expectation [ i ] , CI2EXPECTATIONCOUNTOFF ) ) ** 2 / max ( expectation [ i ] , CI2EXPECTATIONCOUNTOFF ) for i in range ( len ( observation ) ) ) return None
Returns the Chi2-score for an observation and expectation value list.
Returns the Chi2 - score for an observation and expectation value list .
"""Returns the Chi2-score for an observation and expectation value list."""
observation
expectation