News for hackers. Stuff that matters.
Re:Some Insights from a Julia Developer by baldfat on Saturday October 14, 2017 @12:40PM (#15472946)
> To quote wikipedia on Zero-based "Zero-based numbering or index origin = 0[1][2] is a way of numbering in which the initial element of a sequence is assigned the index 0, rather than the index 1 as is typical in everyday non-mathematical/non-programming circumstances."

1 Based

0 = 1

1 = 2

Zero based

0 = nothing

1 = 1

Seem important for mathematics.

Re:Some Insights from a Julia Developer by baldfat on Saturday October 14, 2017 @06:54PM (#15474769)
Also head and tail in Pandas is 1 based! That drove me crazy.

print(users[users.age > 25].head(3))

Returns 3 elements and not 4!

Re:Some Insights from a Julia Developer by Bromskloss on Saturday October 14, 2017 @07:36PM (#15474929)
Is it possible that the argument to `head` is the _number_ of elements to return, and that the choice of indexing therefore doesn't enter the picture?
Re:Some Insights from a Julia Developer by Bromskloss on Sunday October 15, 2017 @12:06AM (#15475839)
Actually, even if the argument (3 in this case) were an index, I would expect it to be the index of the first element _not_ to fetch, like how intervals typically are written with an inclusive lower bound and an exclusive upper bound as in "2 ≤ i < 13" [0]. That would make the result you're getting consistent with zero-indexing, but not with one-indexing.

Of course, I don't know what Pandas is like outside this particular example, or what Pandas even is. A database thing?

[0] https://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF