w3resource

Pandas DataFrame: abs() function

DataFrame - abs() function

The abs() function returns a Series/DataFrame with absolute numeric value of each element.

This function only applies to elements that are all numeric.

Syntax:

DataFrame.abs(self)

Returns: abs
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 Pandas DataFrame Notebooks from here.

Previous: DataFrame - ewm() function
Next: DataFrame - all() function



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/pandas/dataframe/dataframe-abs.php