Skip to Content
Functional Python Programming - Second Edition
book

Functional Python Programming - Second Edition

by Steven F. Lott
April 2018
Intermediate to advanced content levelIntermediate to advanced
408 pages
10h 42m
English
Packt Publishing
Content preview from Functional Python Programming - Second Edition

Computing the chi-squared value

The value is based on , where the e values are the expected values and the o values are the observed values. In our case, we have two dimensions, shift, s, and defect type, t, which leads to .

We can compute the specified formula's value as follows:

diff = lambda e, o: (e-o)**2/echi2 = sum(    diff(expected[s, t], defects[s, t])    for s in shift_totals     for t in type_totals)

We've defined a small lambda to help us optimize ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Python Programming - Third Edition

Functional Python Programming - Third Edition

Steven F. Lott

Publisher Resources

ISBN: 9781788627061Supplemental Content