You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm constantly missing the key argument to Python's max() and min() functions which can be used to specify a function that returns a sort key, just like the by argument to Julia's sort().
Given that finding the minimum/maximum is equivalent to finding the first/last element of a collection in sorted order, it only makes sense to allow alternate Base.Order.Orderings just as in Base.sort(). This would entail adding by, lt, and ord keyword arguments to max, maximum, findmax, argmax, and their counterparts.
I'm definitely prepared to write the implementation myself if this is a desired feature.
The text was updated successfully, but these errors were encountered:
More or less a duplicate, but I'm proposing we also add the lt and ord arguments from Base.sort. I'd expect those to be used far less but it makes sense to make the API consistent with sort.
I'm constantly missing the
key
argument to Python'smax()
andmin()
functions which can be used to specify a function that returns a sort key, just like theby
argument to Julia'ssort()
.Given that finding the minimum/maximum is equivalent to finding the first/last element of a collection in sorted order, it only makes sense to allow alternate
Base.Order.Ordering
s just as inBase.sort()
. This would entail addingby
,lt
, andord
keyword arguments tomax
,maximum
,findmax
,argmax
, and their counterparts.I'm definitely prepared to write the implementation myself if this is a desired feature.
The text was updated successfully, but these errors were encountered: