#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ENGG1811. Exercise on using max and argmax """ import numpy as np # %% Problem parameters # # Create a list of lists temp_array = np.array( [[ 0.3, 0.4, 0.5, 0.5, 0.1, 0.8, 0.8, 0.5, 0.0, 0.7], [ 0.2, 0.4, 0.8, 0.4, 0.8, 1.8, 0.9, 0.1, 1.4, 1.7], [ 1.1, 0.1, 0.8, 0.9, 0.5, 0.3, 0.2, 0.2, 1.1, 0.4], [ 0.4, 0.7, 0.6, 0.6, 0.4, 0.4, 0.5, 0.0, 0.1, 0.2], [ 0.2, 0.1, 0.9, 0.9, 0.3, 0.5, 0.4, 0.7, 0.2, 0.7]] ) # Each list contains data from a thermometer # %% # Put your answers below here: # The maximum temperature of each thermometer np.max(temp_array, axis = 1) # The index of the thermometer with the highest # temperature in the 2nd column np.argmax(temp_array[:,1])