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 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 numpy.reciprocal() in Python The numpy.reciprocal() is a mathematical function that is used to calculate reciprocal of all the elements in the input array. Syntax :numpy.reciprocal(x, /, out=None, *, where=True) Parameters : x[array_like]: Input array or object whose elements needed to test. out [ndarray, optional]: A location 2 min read numpy.floor() in Python The numpy.floor() function returns the largest integer less than or equal to each element in the input array. It effectively rounds numbers down to the nearest whole number. Let's understand with an example:Pythonimport numpy as np a = [0.5, 1.5, 2.5, 3, 4.5, 10.1] res = np.floor(a) print("Floored:" 1 min read Python math.sqrt() function | Find Square Root in Python math.sqrt() returns the square root of a number. It is an inbuilt function in the Python programming language, provided by the math module. In this article, we will learn about how to find the square root using this function.Example:Pythonimport math # square root of 0 print(math.sqrt(0)) # square r 2 min read numpy.poly() in Python The numpy.poly() function in the Sequence of roots of the polynomial returns the coefficient of the polynomial. Syntax :numpy.poly(seq) Parameters : Seq : sequence of roots of the polynomial roots, or a matrix of roots. Return: 1D array having coefficients of the polynomial from the highest degree t 2 min read Python | math.floor() function In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.floor() function returns the largest integer not greater than x. If number is already integer, same number is returned. Syntax: math.floor(x) Parameter: x: This is a numeric e 1 min read Like