Sync
This commit is contained in:
parent
6f050a029e
commit
776bba907c
3887 changed files with 59894 additions and 7280 deletions
|
|
@ -1 +1,11 @@
|
|||
np.mat(np.eye(size))
|
||||
>>> def identity(size):
|
||||
... return {(x, y):int(x == y) for x in range(size) for y in range(size)}
|
||||
...
|
||||
>>> size = 4
|
||||
>>> matrix = identity(size)
|
||||
>>> print('\n'.join(' '.join(str(matrix[(x, y)]) for x in range(size)) for y in range(size)))
|
||||
1 0 0 0
|
||||
0 1 0 0
|
||||
0 0 1 0
|
||||
0 0 0 1
|
||||
>>>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue