Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
talib.LN
Calculates the natural logarithm of each element (Vector Log Natural).
talib.LN(inReal)Examples
Compute the natural logarithm of a few numbers.
javascript
function main() {
var data = [1, 2, 3]
var ret = talib.LN(data)
// Output: about [0, 0.6931, 1.0986]
Log(ret)
}
python
import talib
import numpy as np
def main():
data = [1.0, 2.0, 3.0]
ret = talib.LN(np.array(data))
# Output: about [0, 0.6931, 1.0986]
Log(ret)Returns
| Type | Description |
numeric array | Results, the same length as the input. |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | K-line array (close prices are used) or numeric array; in Python, pass a numeric array such as |
See Also
Remarks
TA-Lib equivalent: LN(Records[Close]) = Array(outReal).