w3resource

Pandas Series: abs() function

Pandas absolute value of column

The abs() function is used to get a Series/DataFrame with absolute numeric value of each element.

This function only applies to elements that are all numeric.

Syntax:

Series.abs(self)
Pandas Series abs image

Parameters: No parameters

Returns: Series/DataFrame containing the absolute value of each element.

Notes: For complex inputs, 1.2 + 1j, the absolute value is √a2+b2

Example:


Download the above Notebook from here.



Inviting useful, relevant, well-written and unique guest posts