The best lap

Report a typo

You have a sample from the Formula 1 dataset. It contains drivers as indexes and columns with lap times in milliseconds:

           Lap_1  Lap_2  Lap_3  Lap_4
Vettel     98109  93006  92713  92803
Hamilton  100573  93774  92900  92582
Webber    101467  93725  93208  92933
Massa     104196  94485  95664  93900
Rosberg   105340  95808  95436  95810

Insert one line in the print function to aggregate the data over the columns to find the best lap time for each driver. In other words, you need to find the minimum value from all four columns.

Write a program in Python 3
import pandas as pd

race_sample = {'Lap_1': [98109, 100573, 101467, 104196, 105340],
'Lap_2': [93006, 93774, 93725, 94485, 95808],
'Lap_3': [92713, 92900, 93208, 95664, 95436],
'Lap_4': [92803, 92582, 92933, 93900, 95810]}

df = pd.DataFrame(race_sample, index=['Vettel', 'Hamilton', 'Webber', 'Massa', 'Rosberg'])

# your code here
print(...)
___

Create a free account to access the full topic