ee.Array.identity

Tworzy dwuwymiarową macierz tożsamości o podanym rozmiarze.

WykorzystanieZwroty
ee.Array.identity(size)Tablica
ArgumentTypSzczegóły
sizeLiczba całkowitaDługość każdej osi.

Przykłady

Edytor kodu (JavaScript)

// []
print(ee.Array.identity(0));

// [[1]]
print(ee.Array.identity(1));

// [[1,0],
//  [0,1]]
print(ee.Array.identity(2));

// [[1,0,0],
//  [0,1,0],
//  [0,0,1]]
print(ee.Array.identity(3));

Konfiguracja Pythona

Informacje o interfejsie Python API i używaniu geemap do interaktywnego programowania znajdziesz na stronie Środowisko Python.

import ee
import geemap.core as geemap

Colab (Python)

# []
display(ee.Array.identity(0))

# [[1]]
display(ee.Array.identity(1))

# [[1, 0],
#  [0, 1]]
display(ee.Array.identity(2))

# [[1, 0, 0],
#  [0, 1, 0],
#  [0, 0, 1]]
display(ee.Array.identity(3))