Python | Pandas Series.abs() Last Updated : 29 Jun, 2021 Comments Improve Suggest changes 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.Pandas Series.abs() method is used to get the absolute numeric value of each element in Series/DataFrame. Syntax: Series.abs()Parameters: No parametersReturns: Return the Series or DataFrame containing the absolute value of each element. Code #1: Python3 # importing pandas module import pandas as pd # creating lists lst = [2, -10.87, -3.14, 0.12] lst2 = [-10.87 + 4j] ser = pd.Series(lst) ser1 = pd.Series(lst2) # printing values explaining abs() print(ser1.abs(), '\n\n', ser.abs()) Output: 0 11.582612 dtype: float64 0 2.00 1 10.87 2 3.14 3 0.12 dtype: float64 Code #2: Explaining use of abs() on specific row Python3 # importing pandas module import pandas as pd df = pd.DataFrame({'Name': ['John', 'Hari', 'Peter', 'Loani'], 'Age': [31, 29, 57, 40], 'val': [98, 48, -80, -14]}) df['ope'] = (df.val - 87).abs() df Output: Name Age val ope 0 John 31 98 11 1 Hari 29 48 39 2 Peter 57 -80 167 3 Loani 40 -14 101 Comment More infoAdvertise with us S Shivam_k Follow Improve Article Tags : Python Python-pandas Python pandas-series Python pandas-series-methods Practice Tags : python Explore Python FundamentalsPython Introduction 3 min read Input and Output in Python 4 min read Python Variables 6 min read Python Operators 5 min read Python Keywords 2 min read Python Data Types 8 min read Conditional Statements in Python 3 min read Loops in Python - For, While and Nested Loops 7 min read Python Functions 8 min read Recursion in Python 6 min read Python Lambda Functions 6 min read Python Data StructuresPython String 6 min read Python Lists 6 min read Python Tuples 6 min read Dictionaries in Python 7 min read Python Sets 10 min read Python Arrays 9 min read List Comprehension in Python 4 min read Advanced PythonPython OOP Concepts 11 min read Python Exception Handling 6 min read File Handling in Python 4 min read Python Database Tutorial 4 min read Python MongoDB Tutorial 2 min read Python MySQL 9 min read Python Packages 12 min read Python Modules 7 min read Python DSA Libraries 15 min read List of Python GUI Library and Packages 11 min read Data Science with PythonNumPy Tutorial - Python Library 3 min read Pandas Tutorial 6 min read Matplotlib Tutorial 5 min read Python Seaborn Tutorial 15+ min read StatsModel Library- Tutorial 4 min read Learning Model Building in Scikit-learn 8 min read TensorFlow Tutorial 2 min read PyTorch Tutorial 7 min read Web Development with PythonFlask Tutorial 8 min read Django Tutorial | Learn Django Framework 10 min read Django ORM - Inserting, Updating & Deleting Data 4 min read Templating With Jinja2 in Flask 6 min read Django Templates 7 min read Python | Build a REST API using Flask 3 min read How to Create a basic API using Django Rest Framework ? 4 min read Python PracticePython Quiz 3 min read Python Coding Practice 1 min read Python Interview Questions and Answers 15+ min read Like