dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.
http://pydash.readthedocs.io
MIT License
1.28k stars 89 forks source link

max_by should return max value, not object #209

Closed stephanelsmith closed 9 months ago

stephanelsmith commented 9 months ago

From lodash https://lodash.com/docs/#maxBy

This would also be consistent with sum_by, mean_by, etc...

dgilland commented 9 months ago

I'm not sure I follow since the examples on https://lodash.com/docs/#maxBy have objects being returned which is what pydash does too when a list of objects is passed in.

stephanelsmith commented 9 months ago

You're right... it seems inconsistent to me in lodash. The documentation a bit different from the example. Sum_by, mean_by, etc... return just the value. Min_by is like max_by. Weird....

Sorry about that. I love this library btw.

dgilland commented 9 months ago

No worries! Glad you've found library useful!