title: Using variable tuple to access elements of list
body: <p>Disclaimer:beginner, self-teaching Python user.  </p>
  
  <p>A pretty cool feature of ndarrays is their ability to accept a tuple of integers as indices (e.g. <code>myNDArray[(1,2)] == myNDArray[1][2]</code>). This allows me to leave the indices unspecified as a variable (e.g. indicesTuple ) until a script determines what part of an ndarray to work with, in which case the variable is specified as a tuple of integers and used to access part of an ndarray (e.g. <code>myNDArray[indicesTuple]</code>). The utility in using a variable is that the LENGTH of the tuple can be varied depending on the dimensions of the ndarray.  </p>
  
  <p>However, this limits me to working with arrays of numerical values. I tried using lists, but they can't take in a tuple as indices (e.g. <code>myList[(1,2)]</code> gives an error.). Is there a way to "unwrap" a tuple for list indices as one could for function arguments? Or something far easier or more efficient?</p>
  
  <p>UPDATE: Holy shite I forgot this existed. Basically I eventually learned that you can initialize the ndarray with the argument dtype=object, which allows the ndarray to contain multiple types of Python objects, much like a list. As for accessing a list, as a commenter pointed out, I could use a for-loop to iterate through the variable indicesTuple to access increasingly nested elements of the list. For in-place editing, see the accepted comment, really went the extra mile there.</p>