From c04e0f756428e56bf409dcbcd4c868f40fde431f Mon Sep 17 00:00:00 2001 From: cenuno <24255819+cenuno@users.noreply.github.com> Date: Sat, 1 Jun 2019 18:28:45 -0700 Subject: [PATCH 1/2] Fix total() so it returns the input xs --- scratch/crash_course_in_python.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scratch/crash_course_in_python.py b/scratch/crash_course_in_python.py index 62dd27f0..71608d4a 100644 --- a/scratch/crash_course_in_python.py +++ b/scratch/crash_course_in_python.py @@ -714,12 +714,12 @@ def ugly_function(value: int, operation: Union[str, int, float, bool]) -> int: ... def total(xs: list) -> float: - return sum(total) + return sum(xs) from typing import List # note capital L def total(xs: List[float]) -> float: - return sum(total) + return sum(xs) # This is how to type-annotate variables when you define them. # But this is unnecessary; it's "obvious" x is an int. @@ -769,4 +769,3 @@ def comma_repeater(s: str, n: int) -> str: def total(xs: Numbers) -> Number: return sum(xs) - From 34255402a6b9348c41d7624e292067c93b4418a8 Mon Sep 17 00:00:00 2001 From: Joel Grus Date: Fri, 7 Jun 2019 20:43:12 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bdee087..afc92b41 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ If you are on Windows, it's [potentially more complicated](https://stackoverflow 4. [Linear Algebra](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/linear_algebra.py) 5. [Statistics](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/statistics.py) 6. [Probability](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/probability.py) -7. [Hypothesis and Inference](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/hypothesis_and_inference.py) +7. [Hypothesis and Inference](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/inference.py) 8. [Gradient Descent](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/gradient_descent.py) 9. [Getting Data](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/getting_data.py) 10. [Working With Data](https://github.com/joelgrus/data-science-from-scratch/blob/master/scratch/working_with_data.py)