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 › doc › 2.1 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.1 Manual
An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2 }\). This is a scalar if x is a scalar. ... >>> import numpy as np >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> np.absolute(1.2 + 1j) ...
🌐
Codecademy
codecademy.com › docs › python:numpy › math methods › .abs()
Python:NumPy | Math Methods | .abs() | Codecademy
June 12, 2025 - Calculates the absolute value of a given number or each element in an array.
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 - Posted: 2024-01-14 | Tags: Python, NumPy · You can calculate the absolute value element-wise in a NumPy array (ndarray) using np.abs(), np.absolute(), or np.fabs(). Note that np.abs() is simply an alias for np.absolute(). Additionally, the ...
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.4 Manual
An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2 }\). This is a scalar if x is a scalar. ... Try it in your browser! >>> import numpy as np >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> ...
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.5.dev0 Manual
An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2 }\). This is a scalar if x is a scalar. ... Try it in your browser! >>> import numpy as np >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> ...
🌐
Medium
mr-amit.medium.com › what-is-numpy-absolute-and-when-to-use-it-0a2c48189200
What is numpy.absolute() and When to Use It? | by It's Amit | Medium
March 6, 2025 - Imagine you have an array with a mix of positive and negative numbers, and you want to strip away the negatives, leaving only the absolute values. Here’s how you can do it: import numpy as np # Example array with positive and negative values arr = np.array([-1, -2, 3, -4]) result = np.absolute(arr) print("Original Array:", arr) print("Absolute Values:", result)
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-absolute-python
numpy.absolute() in Python - GeeksforGeeks
November 29, 2018 - # Python program explaining # absolute () function import numpy as np a = 4 + 3j print("Absolute(4 + 3j) : ", np.absolute(a)) b = 16 + 13j print("\nAbsolute value(16 + 13j) : ", np.absolute(b)) Output : Absolute(4 + 3j) : 5.0 Absolute value(16 + 13j) : 20.6155281281 Code #3: Graphical Representation of numpy.absolute() Python3 ·
Find elsewhere
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › absolute
Python Numpy absolute() - Calculate Absolute Value | Vultr Docs
November 6, 2024 - Import the NumPy library. Create a numpy array with both positive and negative numbers. Calculate the absolute values using the numpy.absolute() function. ... import numpy as np data = np.array([-1, -2, 3, -4]) abs_values = np.absolute(data) ...
🌐
YouTube
youtube.com › watch
NumPy np.abs() Tutorial - Calculate Absolute Values in Python (Beginner Friendly) - YouTube
📐 Learn how to calculate absolute values in Python using NumPy's np.abs() function! This beginner-friendly tutorial covers everything you need to know about...
Published   October 29, 2025
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.2 Manual
An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2 }\). This is a scalar if x is a scalar. ... >>> import numpy as np >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> np.absolute(1.2 + 1j) ...
🌐
TutorialsPoint
tutorialspoint.com › home › numpy › numpy absolute values
NumPy abs() Function
March 5, 2015 - In the following example, we create a 1-dimensional array with both positive and negative numbers and use the abs() function to calculate their absolute values − · import numpy as np # Creating a 1-dimensional array arr = np.array([-1, -2, 3, -4]) # Calculating the absolute values result = np.abs(arr) print(result) Following is the output obtained − ·
🌐
Spark By {Examples}
sparkbyexamples.com › home › python › python numpy absolute value
Python NumPy Absolute Value - Spark By {Examples}
March 27, 2024 - It returns an array with the absolute value for each element of an array. 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.
🌐
Verve AI
vervecopilot.com › hot-blogs › np-abs-python-numpy-skills
What Does Np.Abs Tell Interviewers About Your Python And NumPy Skills
Interviewers ask about np.abs because it reveals deeper competencies than a single function name suggests. Knowing np.abs shows you: Understand element-wise operations on arrays, not just scalar math. Can reason about performance differences between Python loops and vectorized NumPy operations.
🌐
Python Guides
pythonguides.com › python-numpy-absolute-value
NumPy's Np.abs() Function In Python
May 16, 2025 - Learn how to use NumPy's np.abs() function to efficiently calculate absolute values in Python arrays. Includes examples, performance tips, and common issues to avoid
🌐
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]])
🌐
Skytowner
skytowner.com › explore › numpy_abs_method
NumPy | abs method with Examples
Numpy's np.abs(~) method returns a Numpy array with the absolute value applied to each of its values.
🌐
Sharp Sight
sharpsight.ai › blog › numpy-absolute-value
Numpy Absolute Value, Explained - Sharp Sight
July 24, 2021 - The syntax of Numpy absolute value is extremely simple. It’s possibly one of the most simple Numpy functions. We can call the function as np.abs().
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v2.0 Manual
An ndarray containing the absolute value of each element in x. For complex input, a + ib, the absolute value is \(\sqrt{ a^2 + b^2 }\). This is a scalar if x is a scalar. ... >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> np.absolute(1.2 + 1j) 1.5620499351813308
🌐
NumPy
numpy.org › doc › 1.15 › reference › generated › numpy.absolute.html
numpy.absolute — NumPy v1.15 Manual
Calculate the absolute value element-wise. np.abs is a shorthand for this function. Examples · >>> x = np.array([-1.2, 1.2]) >>> np.absolute(x) array([ 1.2, 1.2]) >>> np.absolute(1.2 + 1j) 1.5620499351813308 · Plot the function over [-10, 10]: >>> import matplotlib.pyplot as plt ·