Numeric Functions in python for data science:
We can import a module “math” for performing mathematical operations in Python.
- ceil() – When we use this function, it returns the smallest integral value greater than the number. In case the number is already an integer, the same number will return.
- floor() – When this function is called, it returns the greatest integral value smaller than the number. In case the number is already an integer, the same number is return.
- fabs() – It returns the absolute value of a number.
- factorial() – It returns the factorial of a number. In case the number is not integral, an error message is shown.
- copysign(a, b) – When we use this function it returns the number with value of ‘a’ but with sign of ‘b’. The value which we get back is of float type.
- gcd() – This function takes two numbers as arguments. When the function is called, it computes the greatest common divisor of the numbers given in the argument. This function is found in Python 3.5 and above.