Python | Numpy np.legone() method Last Updated : 31 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report np.legone() method can be used instead of np.ones for creating a array whose elements are 1. Syntax : np.legone() Return : Return array([1]) Example #1 : Python3 1=1 # Python program explaining # numpy.legone() method # import numpy and legone import numpy as np from numpy.polynomial.legendre import legone # using np.legone() method ans = legone print(ans) Output : [1] Example #2 : Python3 1=1 # Python program explaining # numpy.legone() method # import numpy and legone import numpy as np from numpy.polynomial.legendre import legone # using np.legone() method ans = legone + [[1, 3, 5], [2, 4, 6]] print(ans) Output : [[2 4 6] [3 5 7]] Comment More infoAdvertise with us Next Article numpy.floor() in Python J jana_sayantan Follow Improve Article Tags : Python Python-numpy Python numpy-Mathematical Function Practice Tags : python Similar Reads Python | Numpy np.hermeone() method With the help of np.hermeone() method, we can use hermeone instead of np.ones() by using np.hermeone() method. Syntax : np.hermeone Return : Return the array of ones. Example #1 : In this example we can see that by using np.hermeone() method, we are able to get the functionality of np.ones as same a 1 min read Python | Numpy np.hermzero() method With the help of np.hermzero() method, we can use hermzero instead of np.zeros by using np.hermzero() method. Syntax : np.hermzero() Return : Return array([0]) Example #1 : In this example we can see that by using np.hermzero() method, we are able to get the functionality of np.zeros as same as this 1 min read Python | Numpy np.hermezero() method With the help of np.hermezero() method, we can use hermezero instead of np.zeros() by using np.hermezero() method. Syntax : np.hermezero Return : Return the array of zeros. Example #1 : In this example we can see that by using np.hermezero() method, we are able to get the functionality of np.zeros a 1 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 numpy.eye() in Python numpy.eye() is a function in the NumPy library that creates a 2D array with ones on the diagonal and zeros elsewhere. This function is often used to generate identity matrices with ones along the diagonal and zeros in all other positions.Let's understand with the help of an example:Pythonimport nump 2 min read numpy.hypot() in Python This mathematical function helps user to calculate hypotenuse for the right angled triangle, given its side and perpendicular. Result is equivalent to Equivalent to sqrt(x1**2 + x2**2), element-wise. Syntax : numpy.exp2(arr1, arr2[, out]) = ufunc 'hypot') : Parameters : arr1, arr2 : [array_like] Leg 2 min read Like