Skip to content

Commit

Permalink
Move to Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenDowney committed Aug 15, 2023
1 parent b477c6d commit 62034b8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_NAME = ThinkStats2
PYTHON_VERSION = 3.8
PYTHON_VERSION = 3.10
PYTHON_INTERPRETER = python


Expand Down
15 changes: 5 additions & 10 deletions code/thinkstats2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
"""This file contains class definitions for:
This file contains class definitions for:
Hist: represents a histogram (map from values to integer frequencies).
Expand Down Expand Up @@ -2402,10 +2401,10 @@ def NormalProbability(ys, jitter=0):


def Jitter(values, jitter=0.5):
"""Jitters the values by adding a uniform variate in (-jitter, jitter).
"""Jitters the values by adding a random Gaussian values.
values: sequence
jitter: scalar magnitude of jitter
jitter: standard deviation of the added noise
returns: new numpy array
"""
Expand Down Expand Up @@ -2936,9 +2935,7 @@ def PercentileRow(array, p):
"""
rows, cols = array.shape
index = int(rows * p / 100)
return array[
index,
]
return array[index,]


def PercentileRows(ys_seq, percents):
Expand All @@ -2958,9 +2955,7 @@ def PercentileRows(ys_seq, percents):
array = np.zeros((nrows, ncols))

for i, ys in enumerate(ys_seq):
array[
i,
] = ys
array[i,] = ys

array = np.sort(array, axis=0)

Expand Down
4 changes: 1 addition & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
-r requirements.txt
black
flake8
jupyter
nbformat
nbmake
pytest

7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# these versions match Colab as of 2023-04-08
jupyter
numpy==1.22.4
numpy
matplotlib
plotly
seaborn
scipy==1.10.1
statsmodels==0.13.5
scipy
statsmodels
tables

0 comments on commit 62034b8

Please sign in to comment.