From 24e947459b7282469209f71a8390ac0e5d859792 Mon Sep 17 00:00:00 2001 From: Nursultan Sagyntay Date: Fri, 26 Apr 2024 17:48:21 +0400 Subject: [PATCH 1/3] Clarified Array Slicing Syntax --- core/numpy/numpy-basics.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/numpy/numpy-basics.ipynb b/core/numpy/numpy-basics.ipynb index 3281deb5b..ca8644bcc 100644 --- a/core/numpy/numpy-basics.ipynb +++ b/core/numpy/numpy-basics.ipynb @@ -700,7 +700,7 @@ "source": [ "### Slices\n", "\n", - "Slicing syntax is written as `array[start:stop[:step]]`, where **all numbers are optional**.\n", + "Slicing syntax is written as `array[start:stop:step]`, where **all numbers are optional**.\n", "- defaults: \n", " - start = 0\n", " - stop = len(dim)\n", From d16dafa310955fbf6cb32b54d025cb6398120581 Mon Sep 17 00:00:00 2001 From: Nursultan Sagyntay <98964550+kazakhpunk@users.noreply.github.com> Date: Sun, 28 Apr 2024 18:01:27 +0400 Subject: [PATCH 2/3] Update numpy-basics.ipynb Thank you for the feedback. I appreciate the concern about the notation implying that the second colon and the step parameter are mandatory. I propose we adopt 'array[start:stop:step]' as the primary notation in examples but include a clear note in the text explaining that the step parameter is optional: "The step parameter is optional and can be omitted, in which case the slice uses a default step of 1." --- core/numpy/numpy-basics.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/numpy/numpy-basics.ipynb b/core/numpy/numpy-basics.ipynb index ca8644bcc..c1c98d180 100644 --- a/core/numpy/numpy-basics.ipynb +++ b/core/numpy/numpy-basics.ipynb @@ -700,7 +700,7 @@ "source": [ "### Slices\n", "\n", - "Slicing syntax is written as `array[start:stop:step]`, where **all numbers are optional**.\n", + "Slicing syntax is written as `array[start:stop:step]'. Note that **all numbers are optional**. Importantly, the **step** parameter is optional and can be omitted, in which case the slice uses a default step of 1.\n", "- defaults: \n", " - start = 0\n", " - stop = len(dim)\n", From b9d995eb45a243108ada196913c29133eb640b62 Mon Sep 17 00:00:00 2001 From: Nursultan Sagyntay <98964550+kazakhpunk@users.noreply.github.com> Date: Wed, 8 May 2024 10:03:20 +0400 Subject: [PATCH 3/3] Resolved issue with wrong use of parenthesis ` ` --- core/numpy/numpy-basics.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/numpy/numpy-basics.ipynb b/core/numpy/numpy-basics.ipynb index c1c98d180..b798d2136 100644 --- a/core/numpy/numpy-basics.ipynb +++ b/core/numpy/numpy-basics.ipynb @@ -700,7 +700,7 @@ "source": [ "### Slices\n", "\n", - "Slicing syntax is written as `array[start:stop:step]'. Note that **all numbers are optional**. Importantly, the **step** parameter is optional and can be omitted, in which case the slice uses a default step of 1.\n", + "Slicing syntax is written as `array[start:stop:step]`. Note that **all numbers are optional**. Importantly, the **step** parameter is optional and can be omitted, in which case the slice uses a default step of 1.\n", "- defaults: \n", " - start = 0\n", " - stop = len(dim)\n",