Python code for ABS function in excel

How to plot Y=ABS(X) with python code in excel

import numpy as np

import matplotlib.pyplot as plt

x =np.linspace(-1,+1, 100)

lenx=len(x)

y=[]

for i in range(lenx):     

y.append(abs(x[i]))     

i +=1    

plt.plot(x,y)  

plt.show() 

Abs function

The ABSOLUTE ABS function is one of the math functions in Excel. It removes the sign of a number and returns just a positive number.

Abs arguments 

  • The argument of ABS function is number.
  • This function has just 1 Argument.
  • The argument of ABS function is required and not optional.
ABS(+-number) = +number

Leave a Reply

Your email address will not be published. Required fields are marked *