On this page
numpy.lib.scimath.logn
lib.scimath.logn(n, x)[source]-
Take log base n of x.
If
xcontains negative inputs, the answer is computed and returned in the complex domain.- Parameters
-
narray_like-
The integer base(s) in which the log is taken.
xarray_like-
The value(s) whose log base
nis (are) required.
- Returns
-
outndarray or scalar-
The log base
nof thexvalue(s). Ifxwas a scalar, so isout, otherwise an array is returned.
Examples
>>> np.set_printoptions(precision=4)>>> np.lib.scimath.logn(2, [4, 8]) array([2., 3.]) >>> np.lib.scimath.logn(2, [-4, -8, 8]) array([2.+4.5324j, 3.+4.5324j, 3.+0.j ])
© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.20/reference/generated/numpy.lib.scimath.logn.html