numpy.roots() function - Python Last Updated : 11 Jun, 2020 Comments Improve Suggest changes Like Article Like Report numpy.roots() function return the roots of a polynomial with coefficients given in p. The values in the rank-1 array p are coefficients of a polynomial. If the length of p is n+1 then the polynomial is described by: p[0] * x**n + p[1] * x**(n-1) + ... + p[n-1]*x + p[n] Syntax : numpy.roots(p) Parameters : p : [array_like] Rank-1 array of polynomial coefficients. Return : [ndarray] An array containing the roots of the polynomial. Code #1 : Python3 # Python program explaining # numpy.roots() function # importing numpy as geek import numpy as geek p = [1, 2, 3] gfg = geek.roots(p) print (gfg) Output : [-1.+1.41421356j -1.-1.41421356j] Code #2 : Python3 # Python program explaining # numpy.roots() function # importing numpy as geek import numpy as geek p = [3.2, 2, 1] gfg = geek.roots(p) print (gfg) Output : [-0.3125+0.46351241j -0.3125-0.46351241j] Comment More infoAdvertise with us Next Article numpy.roots() function - Python S sanjoy_62 Follow Improve Article Tags : Python Python-numpy Practice Tags : python Similar Reads numpy.sqrt() in Python numpy.sqrt() in Python is a function from the NumPy library used to compute the square root of each element in an array or a single number. It returns a new array of the same shape with the square roots of the input values. The function handles both positive and negative numbers, returning NaN for n 2 min read pow() Function - Python pow() function in Python is a built-in tool that calculates one number raised to the power of another. It also has an optional third part that gives the remainder when dividing the result. Example:Pythonprint(pow(3,2))Output9 Explanation: pow(3, 2) calculates 32 = 9, where the base is positive and t 2 min read Python int() Function The Python int() function converts a given object to an integer or converts a decimal (floating-point) number to its integer part by truncating the fractional part.Example:In this example, we passed a string as an argument to the int() function and printed it.Pythonage = "21" print("age =", int(age) 3 min read numpy.cbrt() in Python This mathematical function helps user to calculate cube root of x for all x being the array elements. Syntax: numpy.cbrt(arr, out = None, ufunc âcbrtâ) : Parameters : arr : [array_like] Input array or object whose elements, we need to square. Return : An array with cube root of x for all x i.e. arra 2 min read hypot() function - Python math.hypot() function in Python is used to compute the Euclidean distance from the origin (0, 0) to a point (x, y) in a 2D plane. It calculates the hypotenuse of a right triangle, given the lengths of the two other sides.ExamplePythonimport math x = 3 y = 4 res = math.hypot(x, y) print(res) Output5. 4 min read Like