Compute the logarithm base 10 with NumPy-scimath in Python Last Updated : 25 Apr, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The NumPy package provides us with numpy.lib.scimath.log10 to Compute the logarithm base 10 with scimath in Python. Let's go through the syntax as per the following to understand the method much better. Syntax: lib.scimath.log10(x) Returns the "primary value" of (see numpy.log10). This is a real number if real x > 0 (log10(0) = -inf, log10(np.inf) = inf). The complicated principle value is returned if none of the above conditions are met. Parameters: x: input array Returns: array or scalar. if x is scalar , a scalar is returned. if x is array, a computed array is returned. Example 1: The NumPy package is imported. we create an array and find its shape, dimensions, and dtype with the .shape, .ndim and .dtype attributes. lib.scimath.log10() method is used to find the logarithm base 10. Python3 # import packages import numpy as np # Creating an array array = np.array([10,20,30]) print(array) # shape of the array is print("Shape of the array is : ",array.shape) # dimension of the array print("The dimension of the array is : ",array.ndim) # Datatype of the array print("Datatype of our Array is : ",array.dtype) # computing log10 for the given array print(np.lib.scimath.log10(array)) Output: [10 20 30] Shape of the array is : (3,) The dimension of the array is : 1 Datatype of our Array is : int64 [1. 1.30103 1.47712125] Example 2: As described np.lib.scimath.log10() returns infinity when np.inf is passed, -inf is returned when 0 is passed, and when -inf is passed inf is returned. Python3 import numpy as np # computing log10 print(np.lib.scimath.log10(np.inf)) print(np.lib.scimath.log10(-np.inf)) print(np.lib.scimath.log10(0)) Output: inf (inf+1.3643763538418412j) -inf Comment More infoAdvertise with us Next Article How to create a list of uniformly spaced numbers using a logarithmic scale with Python? S sarahjane3102 Follow Improve Article Tags : Python Python-numpy Python numpy-Mathematical Function Practice Tags : python Similar Reads Compute the logarithm base n with scimath in Python In this article, we will be looking at the approach to computing the logarithm base n with scimath in Python. The NumPy package provides us the numpy.lib.scimath.logn() method to compute the logarithmic base n. the method takes log base n of x. Let's check the syntax to know the method better. The s 2 min read Compute the inverse sine with scimath using NumPy in Python In this article, we will cover how to compute the inverse sine with scimath in Python. np.emath.arcsin method A NumPy array can be created in different ways like, by various numbers, and by defining the size of the Array. It can also be created with the use of various data types such as lists, tuple 2 min read Compute the square root of complex inputs with scimath in Python In this article, we will cover how to compute the square root of complex inputs with scimath in Python using NumPy. ExampleInput: [-1 -2] Output: [0.+1.j 0.+1.41421356j] Explanation: Square root of complex input.NumPy.emath.sqrt method The np.emath.sqrt() method from the NumPy library calculates the 2 min read Compute the sign and natural logarithm of the determinant of an array in Python In this article, we will cover how to compute the sign and natural logarithm of the determinant of an array in Python using NumPy. numpy.linalg.slogdet() method The numpy.linalg.slogdet() method provides us to compute the sign and natural logarithm of the determinant of an array in Python. A call to 3 min read How to create a list of uniformly spaced numbers using a logarithmic scale with Python? In this article, we will create a list of uniformly spaced numbers using a logarithmic scale. It means on a log scale difference between two adjacent samples is the same. The goal can be achieved using two different functions from the Python Numpy library. Functions  Used:numpy.logspace: This functi 3 min read Log and natural Logarithmic value of a column in Pandas - Python This article explores the computation of logarithmic and natural logarithmic values for a column in Pandas using Python. What is Log and Natural Logarithmic?A logarithm is a mathematical function that represents the exponent to which a base must be raised to produce a given number. The logarithm of 4 min read Like