Turn the following data concerning various species of cetacean into a NumPy structured array and order it by (a) mass and (b) population. Determine in each case the index at which Bryde's whale (population: 100000, mass: 25 tonnes) should be inserted to keep the array ordered.
|Atlantic white-sided dolphin||250000||0.235|
|Pacific white-sided dolphin||1000000||0.15|
|North Atlantic right whale||300||75|
|North Pacific right whale||200||80|
|Southern right whale||7000||70|
A text file containing these data is available as whale-data.txt.
To access solutions, please obtain an access code from Cambridge University Press at the Lecturer Resources page for my book (registration required) and then sign up to scipython.com providing this code.