ee.Array

지정된 좌표가 포함된 배열을 반환합니다.

사용반환 값
ee.Array(values, pixelType)배열
인수유형세부정보
values객체변환할 기존 배열 또는 배열을 생성할 숫자/숫자 목록/중첩된 숫자 목록(깊이 무관)입니다. 중첩된 목록의 경우 동일한 깊이에 있는 모든 내부 배열의 길이가 동일해야 하며 숫자는 가장 깊은 수준에만 있을 수 있습니다.
pixelTypePixelType, 기본값: nullvalues 인수에 있는 각 숫자의 유형입니다. 픽셀 유형이 제공되지 않으면 'values'의 숫자에서 추론됩니다. 'values'에 숫자가 없으면 이 유형을 제공해야 합니다.

코드 편집기 (JavaScript)

// Requires an explicit PixelType if no data.
print(ee.Array([], ee.PixelType.int8()));  // Empty []
print(ee.Array([[]], ee.PixelType.uint8()));  // Empty [[]]
print(ee.Array([[], []], ee.PixelType.float()));  // Empty [[], []]

// 1-D Arrays
print(ee.Array([0]));  // [0]
print(ee.Array([0, 1]));  // [0, 1]
// 2-D Arrays
print(ee.Array([[1]]));  // [[1]]
print(ee.Array([[0, 1], [2, 3]]));  // [[0,1],[2,3]]

// Arrays from ee.Number.
print(ee.Array([ee.Number(123).toUint8()]));  // [123]

// Lists are useful ways to construct larger Arrays.
print(ee.Array(ee.List.sequence(0, 10, 2)));  // // [0,2,4,6,8,10]

// Arrays can be used to make Arrays.
var array1D = ee.Array([1, 2, 3]);
// This is a cast.
print(ee.Array(array1D));  // [1,2,3]

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

# Requires an explicit PixelType if no data.
print(ee.Array([], ee.PixelType.int8()).getInfo())  # Empty []
print(ee.Array([[]], ee.PixelType.uint8()).getInfo())  # Empty [[]]
print(ee.Array([[], []], ee.PixelType.float()).getInfo())  # Empty [[], []]

# 1-D Arrays
print(ee.Array([0]).getInfo())  # [0]
print(ee.Array([0, 1]).getInfo())  # [0, 1]
# 2-D Arrays
print(ee.Array([[1]]).getInfo())  # [[1]]
print(ee.Array([[0, 1], [2, 3]]).getInfo())  # [[0,1],[2,3]]

# Arrays from ee.Number.
print(ee.Array([ee.Number(123).toUint8()]).getInfo())  # [123]

# Lists are useful ways to construct larger Arrays.
print(ee.Array(ee.List.sequence(0, 10, 2)).getInfo())  # [0, 2, 4, 6, 8, 10]

# Arrays can be used to make Arrays.
array_one = ee.Array([1, 2, 3])
# This is a cast.
print(ee.Array(array_one).getInfo())  # [1, 2, 3]