I have a rec-array which holds ages in one space, and corresponding values in another. I also have an array which is my desired subset of ages. For example:

ages = np.arange(100)
values = np.random.uniform(low=0, high= 1, size = ages.shape)
data = np.core.rec.fromarrays([ages, values], names='ages,values')
desired_ages = np.array([1,4, 16, 29, 80])

I'm trying to do is something like this:

data.values[data.ages==desired_ages]

But, it's not working. Can anyone tell me the solution to this?