numpy.emath.logn#
- emath.logn(n,x)[source]#
Take log base n of x.
Ifx contains negative inputs, the answer is computed and returned in thecomplex domain.
- Parameters:
- narray_like
The integer base(s) in which the log is taken.
- xarray_like
The value(s) whose log basen is (are) required.
- Returns:
- outndarray or scalar
The log basen of thex value(s). Ifx was a scalar, so isout, otherwise an array is returned.
Examples
>>>importnumpyasnp>>>np.set_printoptions(precision=4)
>>>np.emath.logn(2,[4,8])array([2., 3.])>>>np.emath.logn(2,[-4,-8,8])array([2.+4.5324j, 3.+4.5324j, 3.+0.j ])
On this page