Skip to content

Commit 2943833

Browse files
authored
docs: Small edits to noteworthy differences (#55852)
- The first line edit changes it so that the Julia example goes first, not the Python example, keeping with the general flow of the lines above. - The second adds a "the" that is missing.
1 parent c3af4fc commit 2943833

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/src/manual/noteworthy-differences.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ For users coming to Julia from R, these are some noteworthy differences:
220220
* Unlike Python, Julia allows [AbstractArrays with arbitrary indexes](https://julialang.org/blog/2017/04/offset-arrays/).
221221
Python's special interpretation of negative indexing, `a[-1]` and `a[-2]`, should be written
222222
`a[end]` and `a[end-1]` in Julia.
223-
* Julia requires `end` for indexing until the last element. `x[1:]` in Python is equivalent to `x[2:end]` in Julia.
224-
* In Julia, `:` before any object creates a [`Symbol`](@ref) or *quotes* an expression; so, `x[:5]` is same as `x[5]`. If you want to get the first `n` elements of an array, then use range indexing.
223+
* Julia requires `end` for indexing until the last element. `x[2:end]` in Julia is equivalent to `x[1:]` in Python.
224+
* In Julia, `:` before any object creates a [`Symbol`](@ref) or *quotes* an expression; so, `x[:5]` is the same as `x[5]`. If you want to get the first `n` elements of an array, then use range indexing.
225225
* Julia's range indexing has the format of `x[start:step:stop]`, whereas Python's format is `x[start:(stop+1):step]`. Hence, `x[0:10:2]` in Python is equivalent to `x[1:2:10]` in Julia. Similarly, `x[::-1]` in Python, which refers to the reversed array, is equivalent to `x[end:-1:1]` in Julia.
226226
* In Julia, ranges can be constructed independently as `start:step:stop`, the same syntax it uses
227227
in array-indexing. The `range` function is also supported.

0 commit comments

Comments
 (0)