Index error: invalid index to scalar variable

IndexError: invalid index to scalar variable.
invalid index
generally appears in the np array index error
Here are some examples:

    a = np.array([[1, 2], [3, 4], [5, 6]])
    print(a[0][0][1])

After running, report an error:

IndexError: invalid index to scalar variable.

Therefore, when the above error occurs, we should check whether the index is wrong, such as the original two-dimensional array, using three levels of index.

Read More: