From f418a6e6eea241e80bc70d4918f0c4b9555d87bd Mon Sep 17 00:00:00 2001 From: Pietro Monticone <38562595+pitmonticone@users.noreply.github.com> Date: Mon, 5 Dec 2022 18:27:43 +0100 Subject: [PATCH 1/5] Fix typos in README and exercises files --- README.md | 2 +- exercises/README.md | 2 +- exercises/exercises02.md | 4 ++-- exercises/exercises04.md | 2 +- exercises/exercises07.md | 4 ++-- exercises/exercises14.md | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 587e09e..415d162 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Extras: * in the `/lectures` folder for each book chapter you can find a Jupyter Notebook file with code from this chapter (note that the code is slightly adjusted in comparison to code contained in .jl files in the root folder - to accomodate it for running in Jupyter Notebook). + to accommodate it for running in Jupyter Notebook). ## Setting up your environment diff --git a/exercises/README.md b/exercises/README.md index 0839e01..1d0075f 100644 --- a/exercises/README.md +++ b/exercises/README.md @@ -19,7 +19,7 @@ purpose, require using more functionalities of Julia ecosystem that is covered in the book. This is meant to teach you how to use help and documentation, as this is a very important skill to master. -The files containing exercises have a naming convention `execricesDD.md`, where +The files containing exercises have a naming convention `exercisesDD.md`, where `DD` is book chapter number for which the exercises were prepared. All the exercises should be possible to solve using project environment setting diff --git a/exercises/exercises02.md b/exercises/exercises02.md index 44e35e7..48d8a72 100644 --- a/exercises/exercises02.md +++ b/exercises/exercises02.md @@ -64,7 +64,7 @@ and the error accumulates when we do addition multiple times. than rational 1/7 by increasing the precision of computations using the `big` function: ``` -julia> big(1/7) # convert Floa64 to high-precision float +julia> big(1/7) # convert Float64 to high-precision float 0.142857142857142849212692681248881854116916656494140625 julia> 1/big(7) # construct high-precision float directly @@ -187,7 +187,7 @@ Note the differences in the code: * if there are `0` or `1` element in the collection the function does not do anything (depending on the context we might want to throw an error instead) * in `x[begin], x[end] = x[end], x[begin]` we perform two assignments at the - same time to avoid having to use a temporaty variable `f` (this operation + same time to avoid having to use a temporary variable `f` (this operation is technically called tuple destructuring; we discuss it in later chapters of the book) diff --git a/exercises/exercises04.md b/exercises/exercises04.md index e2e324b..63b5bb8 100644 --- a/exercises/exercises04.md +++ b/exercises/exercises04.md @@ -302,7 +302,7 @@ julia> for i in 1:40 20 18.100 μs (0 allocations: 0 bytes) ``` -Notice that execution time for number `n` is roughly sum of ececution times +Notice that execution time for number `n` is roughly sum of execution times for numbers `n-1` and `n-2`. diff --git a/exercises/exercises07.md b/exercises/exercises07.md index c031aad..439c09d 100644 --- a/exercises/exercises07.md +++ b/exercises/exercises07.md @@ -9,11 +9,11 @@ ### Exercise 1 Random.org provides a service that returns random numbers. One of the ways -how you can use it is by sending HTTP GET reguests. Here is an example request: +how you can use it is by sending HTTP GET requests. Here is an example request: > https://www.random.org/integers/?num=10&min=1&max=6&col=1&base=10&format=plain&rnd=new -If you want to understand all the parameters plese check their meaning +If you want to understand all the parameters please check their meaning [here](https://www.random.org/clients/http/). For us it is enough that this request generates 10 random integers in the range diff --git a/exercises/exercises14.md b/exercises/exercises14.md index 0c56fc1..94bac02 100644 --- a/exercises/exercises14.md +++ b/exercises/exercises14.md @@ -385,7 +385,7 @@ plot([bar(string.(g.n), g.mv; yerror=(g.mv - g.lo95, g.hi95-g.mv)) for g in gdf]...) ``` -As expected error bandwidth gets smaller as `k` encreases. +As expected error bandwidth gets smaller as `k` increases. Note that as `n` increases the estimated value tends to `1-exp(-1)`. From 85448c0b65d0b2cacc14115feed9a794d72f7dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sat, 4 Feb 2023 19:30:34 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 415d162..d64ee70 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,23 @@ # Julia for Data Analysis +## Contents + +* [Additional teaching materials](#additional-teaching-materials) +* [Setting up your environment](#setting-up-your-environment) + * [General instructions](#general-instructions) + * [Note for Linux users](#note-for-linux-users) +* [Organization of the code](#organization-of-the-code) +* [Running the example codes](#running-the-example-codes) +* [Accompanying materials](#accompanying-materials) +* [Data used in the book](#data-used-in-the-book) +* [Errata](#errata) + This repository contains source codes for the ["Julia for Data Analysis"](https://www.manning.com/books/julia-for-data-analysis?utm_source=bkamins&utm_medium=affiliate&utm_campaign=book_kaminski2_julia_3_17_22) book that is written by Bogumił Kamiński and is planned to be published in 2022 by [Manning Publications Co.](https://www.manning.com/) -Extras: +## Additional teaching materials * in the `/exercises` folder for each book chapter you can find 10 additional exercises with solutions (they are meant for self study and are not discussed in the book) @@ -16,6 +28,8 @@ Extras: ## Setting up your environment +### General instructions + In order to prepare the Julia environment before working with the materials presented in the book please perform the following setup steps: @@ -140,3 +154,42 @@ They are respectively: under GPL-3.0 License) * owensboro.zip (for chapter 13, available at The Stanford Open Policing Project under the Open Data Commons Attribution License) + +## Errata + +### Chapter 2, page 30 + +I compare the following expressions: + +``` +x > 0 && println(x) +``` + +and + +``` +if x > 0 + println(x) +end +``` + +where `x = -7`. + +I write there that Julia interprets them both in the same way. +It is true in terms of the fact that in both cases the `println` function is not called (and this is the focus point of the example). +However, there is a difference in the value of these expressions. +The first expression evaluates to `false`, while the second evaluates to `nothing`. + +Here is how you can check it: + +``` +julia> x = -7 +-7 + +julia> show(x > 0 && println(x)) +false +julia> show(if x > 0 + println(x) + end) +nothing +``` From 1b5e081018dffaff2f3c19f4dd8718183a931931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sat, 4 Feb 2023 19:31:13 +0100 Subject: [PATCH 3/5] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d64ee70..46aa019 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Julia for Data Analysis +This repository contains source codes for the +["Julia for Data Analysis"](https://www.manning.com/books/julia-for-data-analysis?utm_source=bkamins&utm_medium=affiliate&utm_campaign=book_kaminski2_julia_3_17_22) +book that is written by Bogumił Kamiński and is planned to be published in 2022 +by [Manning Publications Co.](https://www.manning.com/) + ## Contents * [Additional teaching materials](#additional-teaching-materials) @@ -12,11 +17,6 @@ * [Data used in the book](#data-used-in-the-book) * [Errata](#errata) -This repository contains source codes for the -["Julia for Data Analysis"](https://www.manning.com/books/julia-for-data-analysis?utm_source=bkamins&utm_medium=affiliate&utm_campaign=book_kaminski2_julia_3_17_22) -book that is written by Bogumił Kamiński and is planned to be published in 2022 -by [Manning Publications Co.](https://www.manning.com/) - ## Additional teaching materials * in the `/exercises` folder for each book chapter you can find 10 additional exercises with solutions (they are meant for self study and are not discussed From bea2328ce5322ec4267f96e54f7fea219c7d2765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sat, 4 Feb 2023 19:31:40 +0100 Subject: [PATCH 4/5] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 46aa019..25539c5 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ This repository contains source codes for the ["Julia for Data Analysis"](https://www.manning.com/books/julia-for-data-analysis?utm_source=bkamins&utm_medium=affiliate&utm_campaign=book_kaminski2_julia_3_17_22) -book that is written by Bogumił Kamiński and is planned to be published in 2022 -by [Manning Publications Co.](https://www.manning.com/) +book that is written by Bogumił Kamiński and has been published by [Manning Publications Co.](https://www.manning.com/) ## Contents From 09a4163d60471d7512cf2edf59cb2db55f241b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Sat, 4 Feb 2023 19:32:02 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25539c5..980ddfc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains source codes for the ["Julia for Data Analysis"](https://www.manning.com/books/julia-for-data-analysis?utm_source=bkamins&utm_medium=affiliate&utm_campaign=book_kaminski2_julia_3_17_22) -book that is written by Bogumił Kamiński and has been published by [Manning Publications Co.](https://www.manning.com/) +book that has been written by Bogumił Kamiński and has been published by [Manning Publications Co.](https://www.manning.com/) ## Contents