how to create an index for an array in python code example Example: how do i index into array >>> x = np.arange(10) >>> x[2] 2 >>> x[-2] 8