Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Array Slicing Syntax from 'array[start:stop[:step]]' to 'array[start:stop:step]' #465

Merged
merged 3 commits into from
May 20, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/numpy/numpy-basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a little syntax error here preventing the text from rendering properly.

It should be array[start:stop:step] (closed with the back quote) instead of `array[start:stop:step]'

"- defaults: \n",
" - start = 0\n",
" - stop = len(dim)\n",
Expand Down
Loading