Re:Show HN: Making Python one-liner-fit with the new pwk (Py...
by abhgh on Monday November 23, 2020 @04:23AM
(#25184992)
I agree about Perl; haven't done a lot of one liners with Ruby when I was using the language. Perl was made to be really compact to the detriment of being hard to read. I think Python strikes a nice balance, and you can compress it to a point. In discussions like these I always like to bring out my one-liner k-nearest neighbor classifier [1]! Explanation here [2] (better on a desktop).
[1] https://twitter.com/AbhishekGhose/status/500564420733304833?...
[2] http://quipu-strands.blogspot.com/2014/08/knn-classifier-in-...