From a5c9bdbe2a00e5509f8ae598c74aa1f0d2ba1efa Mon Sep 17 00:00:00 2001 From: Xinhua Gu Date: Thu, 20 Feb 2025 19:59:26 +0100 Subject: [PATCH 1/3] Fix the mistake in the first slicing example (#208) --- chapter_preliminaries/ndarray.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chapter_preliminaries/ndarray.ipynb b/chapter_preliminaries/ndarray.ipynb index eee3aff0..e39f1981 100644 --- a/chapter_preliminaries/ndarray.ipynb +++ b/chapter_preliminaries/ndarray.ipynb @@ -702,7 +702,7 @@ "according to their relative position to the end of the list \n", "by using negative indices.\n", "\n", - "Thus, `[-1]` selects the last element and `[1:3]` \n", + "Thus, `[-1:]` selects the last element and `[1:3]` \n", "selects the second and the third elements as follows:" ] }, @@ -718,7 +718,7 @@ }, "outputs": [], "source": [ - "x.get(\":-1\");" + "x.get(\"-1:\");" ] }, { @@ -872,7 +872,7 @@ "mimetype": "text/x-java-source", "name": "Java", "pygments_lexer": "java", - "version": "14.0.2+12" + "version": "18.0.1+10-24" } }, "nbformat": 4, From a4e06490e3b4b529cf21a75c14f0e0d9b2eac32b Mon Sep 17 00:00:00 2001 From: Xinhua Gu Date: Thu, 20 Feb 2025 20:54:47 +0100 Subject: [PATCH 2/3] Update chapter_preliminaries/ndarray.ipynb Co-authored-by: Xin Yang <105740670+xyang16@users.noreply.github.com> --- chapter_preliminaries/ndarray.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter_preliminaries/ndarray.ipynb b/chapter_preliminaries/ndarray.ipynb index e39f1981..6cc05f8e 100644 --- a/chapter_preliminaries/ndarray.ipynb +++ b/chapter_preliminaries/ndarray.ipynb @@ -702,7 +702,7 @@ "according to their relative position to the end of the list \n", "by using negative indices.\n", "\n", - "Thus, `[-1:]` selects the last element and `[1:3]` \n", + "Thus, `[-1]` selects the last element and `[1:3]` \n", "selects the second and the third elements as follows:" ] }, From 085d213f0667cc935e63424b22eb3732e7deffcf Mon Sep 17 00:00:00 2001 From: Xinhua Gu Date: Thu, 20 Feb 2025 20:55:13 +0100 Subject: [PATCH 3/3] Update chapter_preliminaries/ndarray.ipynb Co-authored-by: Xin Yang <105740670+xyang16@users.noreply.github.com> --- chapter_preliminaries/ndarray.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter_preliminaries/ndarray.ipynb b/chapter_preliminaries/ndarray.ipynb index 6cc05f8e..f2c15392 100644 --- a/chapter_preliminaries/ndarray.ipynb +++ b/chapter_preliminaries/ndarray.ipynb @@ -718,7 +718,7 @@ }, "outputs": [], "source": [ - "x.get(\"-1:\");" + "x.get(\"-1\");" ] }, {