ee.Array.identity

Creates a 2D identity matrix of the given size.

UsageReturns
ee.Array.identity(size)Array
ArgumentTypeDetails
sizeInteger

The length of each axis.

Examples

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

# Your example goes here!