Session Ready
Exercise

Engineering numerical features - taking an average

A good use case for taking an aggregate statistic to create a new feature is to take the mean of columns. Here, you have a DataFrame of running times named running_times_5k. For each name in the dataset, take the mean of their 5 run times.

Instructions
100 XP
  • Create a list of the columns you want to take the average of and store it in a variable named run_columns.
  • Use apply to take the mean() of the list of columns and remember to set axis=1. Use lambda row: in the apply.
  • Print out the DataFrame to see the mean column.