I have created 2 variables. One to hold 200 randomly generated ages, the other to hold 200 randomly generated marks.
from numpy import *
age = random.random_integers(18,40, size=(1,200))
marks = random.random_integers(0,100, size=(1,200))
I'd like to use NumPy to sort the marks array by the age array. eg:
#random student ages
[32 37 53 48 39 44 33 40 56 47]
#random student marks
[167 160 176 163 209 178 201 164 190 156]
#sorted marked according to ages
[32 33 37 39 40 44 47 48 53 56]
[167 201 160 209 164 178 156 163 176 190]
It is a similar question to this one. I am just unsure if a similar solution applies due to the elements being randomly generated.