log10(x, out=None, **kwargs)

Return the base 10 logarithm of the input array, element-wise.

  • x (ndarray or scalar) – Input array or scalar.

  • out (ndarray or None) – A location into which the result is stored. If provided, it must have a shape that the inputs broadcast to. If not provided or None, a freshly-allocated array is returned. The dtype of the output is the same as that of the input if the input is an ndarray.


y – The logarithm to the base 10 of x, element-wise. NaNs are returned where x is negative. This is a scalar if x is a scalar.

Return type

ndarray or scalar


This function only supports input type of float.


>>> np.log10(np.array([1e-15, -3.]))
array([-15.,  nan])