ee.Array.identity

Creates a 2D identity matrix of the given size.

שימושהחזרות
ee.Array.identity(size)מערך
ארגומנטסוגפרטים
sizeמספר שלםהאורך של כל ציר.

דוגמאות

עורך הקוד (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));

הגדרת Python

מידע על Python API ועל שימוש ב-geemap לפיתוח אינטראקטיבי מופיע בדף Python Environment.

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))