i did not under stand.
4 Creating Identity matrix or array**
tup_dim = (1,4)
my_identity_array = np.identity(tup_dim)
print(my_identity_array)
output
TypeError Traceback (most recent call last)
in
1 tup_dim = (1,4)
2
----> 3 my_identity_array = np.identity(tup_dim)
4
5 print(my_identity_array)
/usr/local/anaconda/lib/python3.6/site-packages/numpy/core/numeric.py in identity(n, dtype)
2346 ββ"
2347 from numpy import eye
-> 2348 return eye(n, dtype=dtype)
2349
2350
/usr/local/anaconda/lib/python3.6/site-packages/numpy/lib/twodim_base.py in eye(N, M, k, dtype, order)
199 if M is None:
200 M = N
β> 201 m = zeros((N, M), dtype=dtype, order=order)
202 if k >= M:
203 return m
TypeError: βtupleβ object cannot be interpreted as an integer
β
why this is showing?
i could not understand.
please help.