ee.List.cat

將其他內容串連至清單。

用量傳回
List.cat(other)清單
引數類型詳細資料
這個:list清單
other清單

範例

程式碼編輯器 (JavaScript)

print(ee.List(['dog']).cat(['squirrel']));  // ["dog","squirrel"]
print(ee.List(['moose']).cat(['&', 'squirrel']));  // ["moose","&","squirrel"]

print(ee.List([['a', 'b']]).cat(ee.List([['1', 1]])));  // [["a","b"],["1",1]]

print(ee.List([]).cat(ee.List([])));  // []
print(ee.List([1]).cat(ee.List([])));  // [1]
print(ee.List([]).cat(ee.List([2])));  // [2]

Python 設定

請參閱 Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。

import ee
import geemap.core as geemap

Colab (Python)

print(ee.List(['dog']).cat(['squirrel']).getInfo())  # ['dog', 'squirrel']

# ['moose', '&', 'squirrel']
print(ee.List(['moose']).cat(['&', 'squirrel']).getInfo())

# [['a', 'b'], ['1', 1]]
print(ee.List([['a', 'b']]).cat(ee.List([['1', 1]])).getInfo())

print(ee.List([]).cat(ee.List([])).getInfo())  # []
print(ee.List([1]).cat(ee.List([])).getInfo())  # [1]
print(ee.List([]).cat(ee.List([2])).getInfo())  # [2]