From 7e1158243c0d0f1f241ad3c1fbcc66fb4aae1f43 Mon Sep 17 00:00:00 2001 From: Alexander Ding Date: Tue, 14 Apr 2020 20:32:13 -0400 Subject: [PATCH 1/5] Update README.md to include new jupytext 1.3.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1170581..db7866b2 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Once this environment is created activate it. You may need to manually install a ```shell pip install sphinx-rtd-theme==0.4.3 -pip install jupytext-1.3.0rc1 +pip install jupytext-1.3.2 ``` and install the `plymi` code base from this repo. Clone the present repository and run: From 5fb30e273858efa982259b70fecc6ca48af1ca72 Mon Sep 17 00:00:00 2001 From: Alex Ding Date: Tue, 14 Apr 2020 20:39:04 -0400 Subject: [PATCH 2/5] Update to 1.4.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db7866b2..eb5572da 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Once this environment is created activate it. You may need to manually install a ```shell pip install sphinx-rtd-theme==0.4.3 -pip install jupytext-1.3.2 +pip install jupytext-1.4.2 ``` and install the `plymi` code base from this repo. Clone the present repository and run: From 71c63bdc09f3bec130c551912f900e4dc1d5a43f Mon Sep 17 00:00:00 2001 From: Alex Ding Date: Tue, 14 Apr 2020 20:39:46 -0400 Subject: [PATCH 3/5] Typo fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb5572da..d1929075 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Once this environment is created activate it. You may need to manually install a ```shell pip install sphinx-rtd-theme==0.4.3 -pip install jupytext-1.4.2 +pip install jupytext==1.4.2 ``` and install the `plymi` code base from this repo. Clone the present repository and run: From cbbeb6ebe73a2d6bdae11bb0c27a81c36fb4b298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Alberto=20P=C3=A9rez-Molano?= Date: Wed, 15 Apr 2020 16:01:59 +0200 Subject: [PATCH 4/5] [Module 3] Adds alternative solutions for an exercise (#143) * Adds alternative solutions for an exercise This adds alternatives to the reading comprehension exercise _Assignment via advanced indexing_ of the chapter _Advanced indexing_ from Module 3 * Adds solution with ~np.diagonal~ * Remove example with map Address comments. Remove example with `map` since it is not discussed elsewhere in PLYMI. --- Python/Module3_IntroducingNumpy/AdvancedIndexing.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Python/Module3_IntroducingNumpy/AdvancedIndexing.md b/Python/Module3_IntroducingNumpy/AdvancedIndexing.md index 769b5373..a6ef69fd 100644 --- a/Python/Module3_IntroducingNumpy/AdvancedIndexing.md +++ b/Python/Module3_IntroducingNumpy/AdvancedIndexing.md @@ -695,6 +695,13 @@ This will return a tuple of two integer-valued index-arrays. These contain the i ... [ 0.84, 0.76, 0.25, 0.07]]) >>> x[np.arange(4), np.arange(4)] = range(4) +# equivalent (works for the general case of a square matrix of N-dims) +# x[tuple(np.arange(x) for x in x.shape)] = range(x.shape[0]) + +# equivalent (using numpy built-in functions): +# x[np.diag_indices_from(x)] = np.arange(4) +# np.fill_diagonal(x, np.arange(4)) + >>> x[0.8 < x] += 1 >>> x array([[ 0. , 0.05, 1.84, 0.21], From 728dcf917bd24f7f3c6fc6cbebafaa685cc9e754 Mon Sep 17 00:00:00 2001 From: Patrick O'Shea <63477154+ArtichokeSap@users.noreply.github.com> Date: Wed, 15 Apr 2020 14:59:22 -0500 Subject: [PATCH 5/5] Fixed dict.fromkeys typo in Module 4, pep-8 compliant (#141) (#145) * Typo fix (#141) * Fixed dict.fromkeys typo in Module 4, pep-8 compliant --- Python/Module4_OOP/Methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/Module4_OOP/Methods.md b/Python/Module4_OOP/Methods.md index 92d9723a..6bf8e4fc 100644 --- a/Python/Module4_OOP/Methods.md +++ b/Python/Module4_OOP/Methods.md @@ -200,7 +200,7 @@ __main__.Dummy `dict.fromkeys` is an example of a class method that takes in an iterable, and returns a dictionary whose keys are the elements of that iterable, and whose values all default to `None`. ```python ->>> dict.fromkeys("abcd") +>>> dict.fromkeys("abcd", 2.3) {'a': 2.3, 'b': 2.3, 'c': 2.3, 'd': 2.3} ```