Create an identity matrix of the specified size( >= 0).

Some examples:

```
(1)  =>  [[1]]

(2) => [ [1,0],
         [0,1] ]

       [ [1,0,0,0,0],
         [0,1,0,0,0],
(5) =>   [0,0,1,0,0],
         [0,0,0,1,0],
         [0,0,0,0,1] ]   

```

Source: codewars | Difficulty: EASY
Tags: Matrices

Fundamentals

Data structures

Mathematics

Starter code: def get_matrix(n):
	

Solutions:
def get_matrix(n):
	return [[1 if i == j else 0 for i in range(n)] for j in range(n)]


import numpy

def get_matrix(n):
	return numpy.eye(n, dtype=int).tolist()


get_matrix = lambda n: [[int(i == j) for j in range(n)] for i in range(n)]


def get_matrix(n):
	return [[int(i == j) for j in range(n)] for i in range(n)]


def get_matrix(n):
	return [[[0, 1][i is _] for i in range(n)] for _ in range(n)]


def get_matrix(n):
	return [[x == y for x in range(n)] for y in range(n)]


from numpy import identity, ndarray

def get_matrix(n):
	return identity(n).tolist()


import numpy

def get_matrix(n):
	return numpy.identity(n).tolist()


def get_matrix(n):
	matrix = []
	for idx in range(0, n):
		child_matrix = []
		child_matrix += [0] * idx + [1] + [0] * (n - 1 - idx)
		matrix.append(child_matrix)
	return matrix