The abs() function

The abs() function returns the absolute values of records in the DataFrame. For columns with complex values in the form x+yj, the absolute value is computed as :

abs_df = pd.DataFrame({"Integers": [-1, -2, -3, 0, 2], "Complex": [5+2j, 1+1j, 3+3j, 2+3j, 4+2j]})
abs_df.abs()

The following is the output:

The abs() function

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset