ee.Array.exp
On an element-wise basis, computes the Euler's number e raised to the power of the input.
Usage | Returns |
---|
Array.exp() | Array |
Argument | Type | Details |
---|
this: input | Array | The input array. |
Examples
var empty = ee.Array([], ee.PixelType.int8());
print(empty.exp()); // []
// [Math.pow(Math.E, -1), 1, Math.E, 7.389]
print(ee.Array([-1, 0, 1, 2]).exp());
var start = -5;
var end = 2;
var points = ee.Array(ee.List.sequence(start, end, null, 50));
var values = points.exp();
// Plot exp() defined above.
var chart = ui.Chart.array.values(values, 0, points)
.setOptions({
viewWindow: {min: start, max: end},
hAxis: {
title: 'x',
viewWindowMode: 'maximized',
},
vAxis: {
title: 'exp(x)',
},
lineWidth: 1,
pointSize: 0,
});
print(chart);
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
import altair as alt
import pandas as pd
empty = ee.Array([], ee.PixelType.int8())
display(empty.exp()) # []
# [pow(math.e, -1), 1, math.e, 7.389]
display(ee.Array([-1, 0, 1, 2]).exp())
start = -5
end = 2
points = ee.Array(ee.List.sequence(start, end, None, 50))
values = points.exp()
df = pd.DataFrame({'x': points.getInfo(), 'exp(x)': values.getInfo()})
# Plot exp() defined above.
alt.Chart(df).mark_line().encode(
x=alt.X('x'),
y=alt.Y('exp(x)')
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["`Array.exp()` calculates the exponential of each element in an input array, raising Euler's number (e) to the power of each element."],["The function returns a new array with the calculated exponential values."],["It can be applied to arrays of any numeric data type and even empty arrays."],["The examples provided showcase its usage in both JavaScript and Python environments for interactive visualization."]]],[]]