Every single `reduce` can be replaced with a more intuitive `groupBy`, `partition`, `mapValues`, `keyBy`, etc.Reduce can approximate anything, that doesn't mean we should use it.My favorite antipattern is items.reduce( (acc, item) => ({ ...acc, [item.id]: item, }), {} ); Like, why? Not only is this ridiculously inefficient O(N^2), it's also longer and less understandable than "build a new map" version.
This one doesn't seem expressible in those terms: from functools import reduce df = reduce(DataFrame.union, dfs)
RomanKornev · · focus · HN ↗
Reduce can approximate anything, that doesn't mean we should use it.
My favorite antipattern is
Like, why? Not only is this ridiculously inefficient O(N^2), it's also longer and less understandable than "build a new map" version.tehnub · · focus · HN ↗