The built-in max takes a key function, you can pass that as abs:

>>> max([3, 7, -10], key=abs)
-10

You can call abs again on the result to normalise the result:

>>> abs(max([3, 7, -10], key=abs))
10
Answer from Moses Koledoye on Stack Overflow
🌐
Profound Academy
profound.academy › python-introduction › min-max-abs-DZ25fuVqi5ass7kZdK1v
min max abs - Introduction to Python
November 1, 2024 - When dealing with computations, in many cases it’s required to compute min or max values among several values. To help with those operations python provides built-in functions min(), max(), and abs() to compute the minimum, maximum, and the absolute value correspondingly.
Discussions

python - How to find values with minimal absolute values in several columns ignoring NaNs? - Stack Overflow
I have the following two pandas time series (but the question is also applicable to numpy array): NaN NaN NaN 2 NaN 1 NaN 0 NaN ... More on stackoverflow.com
🌐 stackoverflow.com
math - Elegant mechanism to determine smallest magnitude number but preserve sign in Python - Stack Overflow
I have a Pythonic need to determine the minimum number in terms of absolute value, but preserve its sign. Below is the code I use to do this now. Is there a more elegant mechanism either More on stackoverflow.com
🌐 stackoverflow.com
Ocaml function to output max absolute value of a list.

Since this is for school, I'd rather try to help you think about this than just give you the answer. Let's look at this Socratically.

  1. What's absolute_value supposed to do? In particular, what makes it different from abs?

  2. You have a comment noting that the type of absolute_value is int -> int. But you said you're "able to get the absolute value of a list". What does that mean?

  3. What's the type of my_max?

  4. Finally, what's the type of List.map?

More on reddit.com
🌐 r/ocaml
6
7
August 8, 2019
Sort a column of values by their absolute value
Create a new table with a column that have absolute value of the % column, then create a relationship between the 2 table and sort the original table by the new table's absolute value column? More on reddit.com
🌐 r/PowerBI
2
1
October 4, 2019
🌐
Blender Artists
blenderartists.org › coding › python support
lowest absolute value - Python Support - Blender Artists Community
December 30, 2016 - I tried x = min(abs(a), abs(b), abs(c), abs(d)) the problem is this way I lose the pos/neg sign So, I ended up doing this: if abs(a) <= abs(b): x = a if abs(a) <= abs(c): x = a if abs(a) <= abs(d): x = a else: x = d else: x = c else: x = b if ...
🌐
alpharithms
alpharithms.com › home › articles › programming › python abs(): the absolute value built-in function
Python abs(): The Absolute Value Built-in Function - αlphαrithms
June 16, 2022 - The Python abs() function is part of the standard built-in functions and provides a utility to calculate an absolute value. This function can be used to convert static values to their absolute value as well as dynamic values. In this article, I’ll cover the basic syntax used for Python’s absolute value function, how to use […]
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › minimum-absolute-value-of-k-arri-for-all-possible-values-of-k-over-the-range-0-n-1
Minimum absolute value of (K – arr[i]) for all possible values of K over the range [0, N – 1] - GeeksforGeeks
July 23, 2025 - # Python program for the above approach # Function to find the minimum absolute # value of (K - arr[i]) for each possible # value of K over the range [0, N - 1]| def minimumDistance(arr, N): ind = 0; prev = arr[ind]; s = len(arr); # Traverse ...
🌐
Real Python
realpython.com › python-absolute-value
How to Find an Absolute Value in Python – Real Python
June 4, 2025 - In this case, you take a squared number to the power of one-half (0.5) or one over two (½), which is the same as calculating the square root. Note that both Python implementations based on the algebraic definition suffer from a slight deficiency: ... >>> def absolute_value(x): ...
Find elsewhere
🌐
Programiz
programiz.com › python-programming › methods › built-in › abs
Python abs()
Become a certified Python programmer. Try Programiz PRO! ... The abs() function returns the absolute value of the given number.
🌐
PyQuestHub
pyquesthub.com › understanding-basic-math-operations-in-python-with-abs-min-and-max-functions
Basic Math Operations in Python: Using abs, min, and max Functions
November 21, 2024 - Using the abs function: The abs() function takes a number as input and returns its absolute value. In the example, we assign the value -10 to the variable negative_number, and calling abs(negative_number) gives us 10. Using the min function: The min() function is used to find the smallest number from a list of numbers...
🌐
W3Schools
w3schools.com › python › ref_func_abs.asp
Python abs() Function
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... The abs() function returns the absolute value of the specified number.
🌐
TradingCode
tradingcode.net › python › math › rare-absolute
Absolute values of uncommon Python values • TradingCode
When we use Python’s abs() function, we often work with integers and floating-point value. But abs() has a less-known feature: it can also work with uncommon values. Let’s have a look. In Python, we get the absolute value of numbers with the abs() function.
🌐
Dfrieds
dfrieds.com › python › minimum-absolute-difference.html
Minimum Absolute Difference (via Leetcode) - dan_friedman_learnings
# if absolute difference of pair is equal to min_absolute_difference: # append pair as list to min_pairs_list # else if absolute difference pair is less than min_absolute_difference: # reassign min_absolute_difference to be new absolute difference of pair # if min_pairs_list is empty: # append pair as list to min_pairs_list # else: # we don't want to keep old pairs in min_pairs_list that contain higher abs value among pairs...
🌐
Server Academy
serveracademy.com › blog › python-absolute-value-abs-tutorial
Python Absolute Value Abs() Tutorial - Server Academy
November 12, 2024 - For example, the absolute value ... normalization. In Python, the simplest way to calculate the absolute value is to use the abs() function....
🌐
LearnDataSci
learndatasci.com › solutions › python-absolute-value
Python Absolute Value – abs() for real and complex numbers – LearnDataSci
The sign of the number alludes to which direction along the line the number is; positive values are along the positive axis, and negative ones are along the negative axis. In the quick example shown in the introduction, -5 is a real number. In regards to Python, real numbers are numbers that are integers or floats. The following example demonstrates how we can apply the abs function to a list of integers: real_number_list = [-12, -6, 0, 4, 8] for number in real_number_list: absolute_value = abs(number) print(f'Number: {number}, Absolute Value: {absolute_value}')
🌐
Python documentation
docs.python.org › 3 › library › functions.html
Built-in Functions — Python 3.14.3 documentation
3 weeks ago - Return the smallest item in an iterable or the smallest of two or more arguments.
🌐
Career Karma
careerkarma.com › blog › python › python absolute value: a step-by-step guide
Python Absolute Value: A Step-By-Step Guide | Career Karma
December 1, 2023 - The Python abs() method returns the absolute value of a number. The absolute value of a number is the number’s distance from 0. This makes any negative number positive, while positive numbers are unaffected.
🌐
Plain English
python.plainenglish.io › how-to-find-an-absolute-value-in-python-2ac8f90a34ea
How to Find an Absolute Value in Python | Python in Plain English
June 16, 2025 - Learn how to find absolute values in Python using the abs() function with easy examples, real-world use cases, and beginner-friendly tips.
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › absolute
Python Numpy absolute() - Calculate Absolute Value | Vultr Docs
November 6, 2024 - This function proves invaluable when dealing with numeric data that requires non-negative values for analysis, such as distances, magnitudes, and physical quantities. In this article, you will learn how to apply the numpy.absolute() function across different data types and structures in Python, ...