Python | Pandas DataFrame.abs() Last Updated : 09 Mar, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.dataframe.abs() is one of the simplest pandas dataframe function. It returns an object with absolute value taken and it is only applicable to objects that are all numeric. It does not work with any Nan value either. abs() function can also be used with complex numbers to find their absolute value. For complex numbers, the absolute value is defined as: Syntax: DataFrame.abs() Returns: type of caller For link to CSV file Used in Code, click hereExample #1: Replace team "Boston Celtics" with "Omega Warrior" in the nba.csv file Python3 # importing pandas as pd import pandas as pd # Making data frame from the csv file df = pd.read_csv("nba.csv") # Printing the first 10 rows of the # data frame for visualization df[:10] In order to find the absolute value, we also need to have negative values in the dataframe. So, let's change some values to be negative for the demonstration purpose. Python3 # This will set the Number column # to be all negative. df.Number = df.Number*(-1) Output: Now let's use abs() function to find only the absolute value of the Number column. Python3 # Applying abs() value on one column only df.Number.abs() Output: Example #2: Applying abs() on a series with complex numbers. Python3 # Importing pandas as pd import pandas as pd # Creating a series ser = pd.Series([1.2 + 1j, 2 + 5j, 1 + 8j, 3.2 + 2j]) # let's print the values in series ser Python3 # Using abs() function to find the # absolute value of the complex numbers absolute_values = s.abs() # Print the absolute values of all complex numbers absolute_values Comment More infoAdvertise with us Next Article Python | Pandas dataframe.ne() S Shubham__Ranjan Follow Improve Article Tags : Pandas Python-pandas Python pandas-dataFrame Pandas-DataFrame-Methods AI-ML-DS With Python +1 More Similar Reads Python | Pandas dataframe.clip() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.clip() is used to trim values at specified input threshold. We can us 3 min read Python | Pandas dataframe.eq() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.eq() is a wrapper used for the flexible comparison. It provides a con 3 min read Python | Pandas dataframe.ne() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.Pandas dataframe.ne() function checks for inequality of a dataframe element with a cons 2 min read Python | Pandas dataframe.mad() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.mad() function return the mean absolute deviation of the values for t 2 min read Python | Pandas dataframe.std() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.std() function return sample standard deviation over requested axis. 2 min read Python | Pandas dataframe.min() Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.min() function returns the minimum of the values in the given object. 2 min read Like