It's likely because there a built-in functions with the same name, abs. The same is true for np.amax, np.amin and np.round_.

The aliases for the NumPy functions abs, min, max and round are only defined in the top-level package.

So np.abs and np.absolute are completely identical. It doesn't matter which one you use.

There are several advantages to the short names: They are shorter and they are known to Python programmers because the names are identical to the built-in Python functions. So end-users have it easier (less to type, less to remember).

But there are reasons to have different names too: NumPy (or more generally 3rd party packages) sometimes need the Python functions abs, min, etc. So inside the package they define functions with a different name so you can still access the Python functions - and just in the top-level of the package you expose the "shortcuts". Note: Different names are not the only available option in that case: One could work around that with the Python module builtins to access the built-in functions if one shadowed a built-in name.

It might also be the case (but that's pure speculation on my part) that they originally only included the long-named functions absolute (and so on) and only added the short aliases later. Being a large and well-used library the NumPy developers don't remove or deprecate stuff lightly. So they may just keep the long names around because it could break old code/scripts if they would remove them.

Answer from MSeifert on Stack Overflow
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.5.dev0 Manual
numpy.absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'absolute'>#
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.2 Manual
numpy.absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'absolute'>#
🌐
Codecademy
codecademy.com › docs › python:numpy › math methods › .abs()
Python:NumPy | Math Methods | .abs() | Codecademy
June 12, 2025 - An array containing the absolute value of each element in the input. For complex numbers, returns the magnitude calculated as √(real² + imaginary²). This example demonstrates the fundamental usage of numpy.abs() with different numeric data types:
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.4 Manual
numpy.absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'absolute'>#
Top answer
1 of 3
106

It's likely because there a built-in functions with the same name, abs. The same is true for np.amax, np.amin and np.round_.

The aliases for the NumPy functions abs, min, max and round are only defined in the top-level package.

So np.abs and np.absolute are completely identical. It doesn't matter which one you use.

There are several advantages to the short names: They are shorter and they are known to Python programmers because the names are identical to the built-in Python functions. So end-users have it easier (less to type, less to remember).

But there are reasons to have different names too: NumPy (or more generally 3rd party packages) sometimes need the Python functions abs, min, etc. So inside the package they define functions with a different name so you can still access the Python functions - and just in the top-level of the package you expose the "shortcuts". Note: Different names are not the only available option in that case: One could work around that with the Python module builtins to access the built-in functions if one shadowed a built-in name.

It might also be the case (but that's pure speculation on my part) that they originally only included the long-named functions absolute (and so on) and only added the short aliases later. Being a large and well-used library the NumPy developers don't remove or deprecate stuff lightly. So they may just keep the long names around because it could break old code/scripts if they would remove them.

2 of 3
23

There also is Python's built-in abs(), but really all those functions are doing the same thing. They're even exactly equally fast! (This is not the case for other functions, like max().)

Code to reproduce the plot:

import numpy as np
import perfplot


def np_absolute(x):
    return np.absolute(x)


def np_abs(x):
    return np.abs(x)


def builtin_abs(x):
    return abs(x)


b = perfplot.bench(
    setup=np.random.rand,
    kernels=[np_abs, np_absolute, builtin_abs],
    n_range=[2 ** k for k in range(25)],
    xlabel="len(data)",
)
b.save("out.png")
b.show()
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: Calculate the absolute value element-wise (np.abs, np.fabs) | note.nkmk.me
January 14, 2024 - Get the absolute value with abs() and math.fabs() in Python · a = np.array([-2, -1, 0, 1, 2]) print(a.__abs__()) # [2 1 0 1 2] print(abs(a)) # [2 1 0 1 2] print(type(abs(a))) # <class 'numpy.ndarray'>
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › absolute
Python Numpy absolute() - Calculate Absolute Value | Vultr Docs
November 6, 2024 - The numpy.absolute() function in Python, part of the NumPy library, is designed to calculate the absolute values of the elements in arrays.
🌐
Programiz
programiz.com › python-programming › numpy › methods › absolute
NumPy absolute() (With Examples)
The absolute() function returns an array that contains the absolute value of each element in the input array. import numpy as np # create a 2D array array1 = np.array([[-1, 2, -3.5], [4, -5, -6]])
Find elsewhere
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.1 Manual
numpy.absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature]) = <ufunc 'absolute'>#
🌐
Real Python
realpython.com › python-absolute-value
How to Find an Absolute Value in Python – Real Python
June 4, 2025 - This tutorial shows you how to implement the absolute value function from scratch, use abs() with numbers, and customize its behavior for data types like NumPy arrays and pandas Series. By the end of this tutorial, you’ll understand that: You can implement the absolute value function in Python ...
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python numpy absolute value
Python NumPy Absolute Value - Spark By {Examples}
March 27, 2024 - This mathematical Python NumPy in-built function absolute() takes the input array as a param and returns the absolute value of each element in the input array. An absolute value is a positive value of a given negative value, so it just removes ...
🌐
Sharp Sight
sharpsight.ai › blog › numpy-absolute-value
Numpy Absolute Value, Explained - Sharp Sight
July 24, 2021 - Numpy absolute value calculates absolute values in Python.
🌐
Delft Stack
delftstack.com › home › howto › numpy › python numpy absolute value
How to Calculate Absolute Value in NumPy | Delft Stack
March 11, 2025 - The abs() function works seamlessly with NumPy arrays. When you pass an array to abs(), it processes each element and returns a new array with the absolute values. This method is straightforward and effective for one-dimensional arrays.
🌐
w3resource
w3resource.com › python-exercises › numpy › python-numpy-math-exercise-7.php
NumPy: Calculate the absolute value element-wise - w3resource
Write a NumPy program to calculate the absolute value element-wise. Sample Solution: Python Code: # Importing the NumPy library import numpy as np # Creating an array with floating-point numbers x = np.array([-10.2, 122.2, .20]) # Displaying the original array print("Original array:") print(x) # Calculating the element-wise absolute value and displaying the result print("Element-wise absolute value:") print(np.absolute(x)) Sample Output: Original array: [ -10.2 122.2 0.2] Element-wise absolute value: [ 10.2 122.2 0.2] Explanation: In the above code: x = np.array([-10.2, 122.2, .20]) – This line creates an array with three elements: -10.2, 122.2, and .20.
🌐
Python Guides
pythonguides.com › python-numpy-absolute-value
NumPy's Np.abs() Function In Python
May 16, 2025 - In this article, I’ll cover everything you need to know about using np.abs() in Python (from basic usage to advanced techniques and performance considerations). So let’s get in! ... NumPy’s np.abs() function calculates the absolute value of all elements in an array.
🌐
GeeksforGeeks
geeksforgeeks.org › numpy-absolute-python
numpy.absolute() in Python - GeeksforGeeks
November 29, 2018 - numpy.absolute(arr, out = None, ufunc 'absolute') : This mathematical function helps user to calculate absolute value of each element. For complex input, a + ib, the absolute value is ...
🌐
Educative
educative.io › answers › what-is-the-absolute-function-in-numpy
What is the absolute() function in NumPy?
In NumPy, the absolute() function is used to compute the ... The absolute value of a number is the distance between the number and 0. This distance will always be a positive number.
🌐
TutorialsPoint
tutorialspoint.com › calculate-the-absolute-value-element-wise-in-numpy
Calculate the absolute value element-wise in Numpy
To calculate the absolute value, we can use two methods, fabs() and absolute(). To return the absolute value element-wise, use the numpy.fabs() method in Python Numpy. This displays the output in float. To r
🌐
NumPy
numpy.org › doc › 1.15 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v1.15 Manual
numpy.absolute(x, /, out=None, *, where=True, casting='same_kind', order='K', dtype=None, subok=True[, signature, extobj]) = <ufunc 'absolute'>¶