Please, consider the following lines, where a tuple is starred while being used to index a NumPy array:
import numpy as np
a = np.array([[1,2],[3,4]])
ind = (1, 1)
print(a[*ind])
Python 3.10.7 with NumPy 1.23.2 throws an error (syntax). On the other hand, Python 3.11.2 with NumPy 1.24.2 prints the number “4”.
What changed?
Thank you.