Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

📚 The CoCalc Library - books, templates and other resources

Views: 96144
License: OTHER
1
"""This file contains code used in "Think Stats",
2
by Allen B. Downey, available from greenteapress.com
3
4
Copyright 2010 Allen B. Downey
5
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
6
"""
7
8
import relay
9
import Cdf
10
import myplot
11
12
13
def main():
14
results = relay.ReadResults()
15
speeds = relay.GetSpeeds(results)
16
17
# plot the distribution of actual speeds
18
cdf = Cdf.MakeCdfFromList(speeds, 'speeds')
19
20
myplot.Cdf(cdf)
21
myplot.Save(root='relay_cdf',
22
title='CDF of running speed',
23
xlabel='speed (mph)',
24
ylabel='probability')
25
26
27
if __name__ == '__main__':
28
main()
29
30