AI-generated Key Takeaways
-
Array.get extracts the value at a specified position from an array.
-
The
positionargument, a List, provides the coordinates of the element to retrieve. -
The function returns a Number, which is the value found at the given position.
| Usage | Returns |
|---|---|
Array.get(position) | Number |
| Argument | Type | Details |
|---|---|---|
this: array | Array | The array to extract from. |
position | List | The coordinates of the element to get. |
Examples
Code Editor (JavaScript)
print(ee.Array([9]).get([0])); // 9 print(ee.Array([8, 7, 6]).get([2])); // 6 var array = ee.Array([[0, 1, 2], [3, 4, 5]]); print(array.get([0, 0])); // 0 print(array.get([0, 1])); // 1 print(array.get([1, 0])); // 3 print(array.get([1, 2])); // 5
import ee import geemap.core as geemap
Colab (Python)
display(ee.Array([9]).get([0])) # 9 display(ee.Array([8, 7, 6]).get([2])) # 6 array = ee.Array([[0, 1, 2], [3, 4, 5]]) display(array.get([0, 0])) # 0 display(array.get([0, 1])) # 1 display(array.get([1, 0])) # 3 display(array.get([1, 2])) # 5