Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Think Stats by Allen B. Downey Think Stats is an introduction to Probability and Statistics for Python programmers.

This is the accompanying code for this book.

Website: http://greenteapress.com/wp/think-stats-2e/

Views: 7114
License: GPL3
1
"""This file contains code for use with "Think Stats",
2
by Allen B. Downey, available from greenteapress.com
3
4
Copyright 2014 Allen B. Downey
5
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
6
"""
7
8
from __future__ import print_function, division
9
10
import unittest
11
import random
12
13
from collections import Counter
14
import numpy as np
15
16
import thinkstats2
17
import thinkplot
18
19
class Test(unittest.TestCase):
20
21
def testHist(self):
22
hist = thinkstats2.Hist(['red', 'green', 'blue'])
23
hist['red'] += 1
24
print(hist)
25
thinkplot.Hist(hist, width=1)
26
thinkplot.Show()
27
28
29
if __name__ == "__main__":
30
unittest.main()
31
32