About 166,000 results
Open links in new tab
  1. how does the python min function works - Stack Overflow

    Feb 20, 2013 · The min function returns the minimum value of an iterable according to the given key. In this case it returns the key of d with the minimum value. d.get allows you to access the …

  2. python - What is the correct use of "key" in the min() function ...

    Apr 2, 2023 · I have a question about the min() function in Python. I am confused about the use of the "key" option in min(). Could someone explain how key works in min(), especially in relation …

  3. python - Getting the index of the returned max or min item using …

    Mar 19, 2010 · I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the value returned by max() or min().

  4. Python: min(None, x) - Stack Overflow

    Default function in Python using min. 2. Python foolproof min/max function with None. 0. min() function in ...

  5. minimum in python without using min function [python 2.7]

    def minimum(x): mini = x[0] for i in x[0:]: if i < mini: mini = i else: mini = x[0] return (mini) b = [1,2,3,4,5] c= [3,6,2,7,9] print minimum...

  6. python - Find min, max, and average of a list - Stack Overflow

    I am having hard time to figure out how to find min from a list for example somelist = [1,12,2,53,23,6,17] how can I find min and max of this list with defining (def) a function I do not …

  7. key - Keyword functions for Python min/max - Stack Overflow

    min(iterable[, key]) Return the smallest item in an iterable or the smallest of two or more arguments... The optional key argument specifies a one-argument ordering function like that …

  8. Python, lambda, find minimum - Stack Overflow

    Jun 16, 2010 · So, if your only problem with lambda is that you can't use = in a lambda, you can just make a function using def. Now, that said, I don't suggest you use your .foreach() method …

  9. The Python min() function explained, with examples

    Jun 1, 2021 · min() is a built-in function in Python 3. It returns the smallest item in an iterable, or the smallest of two or more arguments. Arguments This function takes two or more numbers …

  10. python - NumPy: function for simultaneous max () and min ()

    Jul 2, 2020 · numpy.amax() will find the max value in an array, and numpy.amin() does the same for the min value. If I want to find both max and min, I have to call both functions, which …

Refresh