ee.Array.first

On an element-wise basis, selects the value of the first value.

UsageReturns
Array.first(right)Array
ArgumentTypeDetails
this: leftArray

The left-hand value.

rightArray

The right-hand value.

Examples

JavaScript

var empty = ee.Array([], ee.PixelType.int8());
print(empty.first(empty));  // []

print(ee.Array([0]).first(0));  // [0]
print(ee.Array([0, 1, 2]).first(1));  // [0,1,2]
print(ee.Array([0, 1, 2]).first(ee.Array([3, 4, 5])));  // [0,1,2]
print(ee.Array([3, 4, 5]).first(ee.Array([0, 1, 2])));  // [3,4,5]

Python

# Your example goes here!