I used Jupyter notebook, I am new to Python, I try to fetch value from user in multidimensional array how I do that? I write a little code, after put first value I get error that I don't understand
Error:
Traceback (most recent call last) <ipython-input-64-4d8986a5e412> in <module> 5 for i in range(lengthrow): 6 for j in range(lengthcol): ----> 7 arr[i][j]=int(input("enter value")) 8 print(arr)IndexError: index 0 is out of bounds for axis 0 with size 0
code:
from numpy import*
arr = array([[],[]])
lengthrow=int(input("enter array row length"))
lengthcol=int(input("enter array col length"))
for i in range(lengthrow):
for j in range(lengthcol):
arr[i][j]=int(input("enter value"))
print(arr)
arra (2,0) shape array.arr[0]is a (0,) shape array. Trying to index that with [0] produces the error.