You probably mean a list object. In which case, that (nor anything that is called an array in python) doesn't let you use a custom index. You'll have to implement that yourself.
I have posted a solution to this question for future references, but as you are "very new to all types of programming" I would definitely not recommend you to start with pandas. Maybe you can post your actual problem and explain why you need custom indexes in the first place so we can guide in in some direction
I'm pretty sure there's a library on someone's blog that implements exactly what you're asking for, as a demonstration of how to create a MutableSequence class that delegates to a list but adds some extra functionality. Unfortunately, I don't have a link. Someone posted a link on my blog post demonstrating how to create a MutableSequence a few years back, but then deleted it… But anyway, building it yourself could be a valuable learning exercise, but maybe too advanced for right now.
Assuming that by "array" you mean list or tuple, and that you don't need to insert or delete elements after creation, you can simulate this with a dictionary: dictarray = {i+2: array[i] for i in range(len(array))}. It's probably not a great idea (you end up with something that acts like a list but with some functionality broken, and that runs slower and doesn't print out as nice), but it might be worth playing with to see how lists and dicts work. (You might want to write that out as an explicit loop instead of a dict comprehension, though, to make sure you understand it.)
listobject. In which case, that (nor anything that is called an array in python) doesn't let you use a custom index. You'll have to implement that yourself.pandas. Maybe you can post your actual problem and explain why you need custom indexes in the first place so we can guide in in some directionMutableSequenceclass that delegates to alistbut adds some extra functionality. Unfortunately, I don't have a link. Someone posted a link on my blog post demonstrating how to create aMutableSequencea few years back, but then deleted it… But anyway, building it yourself could be a valuable learning exercise, but maybe too advanced for right now.listortuple, and that you don't need to insert or delete elements after creation, you can simulate this with a dictionary:dictarray = {i+2: array[i] for i in range(len(array))}. It's probably not a great idea (you end up with something that acts like alistbut with some functionality broken, and that runs slower and doesn't print out as nice), but it might be worth playing with to see howlists anddicts work. (You might want to write that out as an explicit loop instead of a dict comprehension, though, to make sure you understand it.)