I'm trying to run through a for
loop, but looking at the indices, rather than the values of the list. My list looks like this:
ubermin_values = [8350.1416, 13167.329, 29200.063, 19283.514, 23596.0309...]
and it has a total of 100 values (but this changes with each run of the program).
I'm trying to keep track of which value in minimum_pixels
each value in ubermin_values
came from, for plotting. If I use this loop in my code,
ubermin_vals_x = []
for i in ubermin_values:
value = ubermin_pixels[i]
ubermin_vals_x.append(minimum_pixels[i])
it tries to iterate over the values (8350.1416, 13167.329...) but of course this can't be done. I think my scheme should work if I can iterate over the indices of ubermin_values
, rather than the values, but I can't see how to do that.
If it helps, here's how the first values should be mapped:
so that I can plot the points (4, 8350.1416), (10, 13167.329), (7, 29200.063), etc.
The numpy
docs list nditer for iterating over arrays. Am I on the right track with this, or is there a better way to do it?