8 ms·
Interestingly most (if not all) python examples also work in julia. Instead of using sum one can also use count, which might be more readable: julia> count(age
by kwertzzz 3y ago
Interestingly most (if not all) python examples also work in julia.
Instead of using sum one can also use count, which might be more readable:
julia> count(age > 17 for age in ages)
Or even shorter:
julia> count(ages .> 17)
Under the hood many of the functions are implemented using the reduce function (similar to / in APL):
julia> reduce(+,ages .> 17)
I think many languages in data science have been influenced by APL. But sometimes this influence come from an intermediate language like matlab.
- leephillips 3y agoYes. One of the “repercussions” of the author’s experience with APL might have led to him recoiling from the verbosity of his Python examples and exploring languages, like Julia, that can get closer to the APL spirit.