News for hackers. Stuff that matters.
Re:What Learning APL Taught Me About Python by alanbernstein on Thursday August 17, 2023 @04:51AM (#37158934)
I feel like the numpy version is most concise, most readable, and most array-ish:

np.sum(age>17)

(Assumes age is a np.array)

Re:What Learning APL Taught Me About Python by RojerGS on Thursday August 17, 2023 @05:33AM (#37159265)
Yes, this is VERY close to the APL way: +/ages>17

OP here; maybe I'll add a comment to the article to make the comparison between NumPy and APL for this expression. Thanks!

Re:What Learning APL Taught Me About Python by leprechaun1066 on Thursday August 17, 2023 @07:28AM (#37160006)
APL (along with Matlab, K, Mathematica, etc.) was one of the influences for NumPy anyway.