I have a function f([i_0, i_1, ..., i_k-1]) which takes as input a k-dimensional array of integers and returns some object.
Given the range for each index (as a two-dimensional array ranges=[i_0_range, i_1_range, ...]), how do I generate a k-dimensional list / array containing objects evaluated for each value of indices?
If k was fixed, I'd simply do k nested loops. But I would like to have a solution working for any k. How can I do this in Python?