﻿[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:00.59,0:00:03.03,Default,,0000,0000,0000,,All right, why don't we walk through the solution. Dialogue: 0,0:00:03.03,0:00:05.92,Default,,0000,0000,0000,,Here, we're going to start with our olympic_medal_counts_df DataFrame, Dialogue: 0,0:00:05.92,0:00:08.15,Default,,0000,0000,0000,,as we have in the previous exercises. Dialogue: 0,0:00:08.15,0:00:12.16,Default,,0000,0000,0000,,First, we're going to create a new, smaller dataframe called metal counts, Dialogue: 0,0:00:12.16,0:00:16.48,Default,,0000,0000,0000,,which is the olympic_medal_count_df DataFrame, but only the gold, silver, and Dialogue: 0,0:00:16.48,0:00:17.12,Default,,0000,0000,0000,,bronze columns. Dialogue: 0,0:00:18.40,0:00:22.18,Default,,0000,0000,0000,,Then we're going to use the numpy.dot function to matrix multiply this Dialogue: 0,0:00:22.18,0:00:26.81,Default,,0000,0000,0000,,metal_counts_matrix with the 4, 2, 1 array which represents the number of Dialogue: 0,0:00:26.81,0:00:30.46,Default,,0000,0000,0000,,points that each country would score for a gold, silver, or bronze medal. Dialogue: 0,0:00:30.46,0:00:33.28,Default,,0000,0000,0000,,So what we're going to get here is an array, Dialogue: 0,0:00:33.28,0:00:37.19,Default,,0000,0000,0000,,where the value is 4 times the number of gold medals plus 2 times the number of Dialogue: 0,0:00:37.19,0:00:41.02,Default,,0000,0000,0000,,silver medals plus 1 times the number of bronze medals. Dialogue: 0,0:00:41.02,0:00:44.75,Default,,0000,0000,0000,,Down here, I'm going to define this Python dictionary called olympic_points, Dialogue: 0,0:00:44.75,0:00:46.43,Default,,0000,0000,0000,,where again I provide us the keys, Dialogue: 0,0:00:46.43,0:00:50.49,Default,,0000,0000,0000,,the column names, and as the values panda series, where I provide as Dialogue: 0,0:00:50.49,0:00:55.37,Default,,0000,0000,0000,,the argument first the list of country names and here, this array points, Dialogue: 0,0:00:55.37,0:00:58.04,Default,,0000,0000,0000,,which again has the total number of points that each country earned. Dialogue: 0,0:00:59.15,0:01:05.83,Default,,0000,0000,0000,,Finally, I'm just going to say olympic_points_df is DataFrame of olympic_points. Dialogue: 0,0:01:05.83,0:01:08.60,Default,,0000,0000,0000,,This is just the tip of the iceberg when it comes to pandas and Dialogue: 0,0:01:08.60,0:01:10.61,Default,,0000,0000,0000,,numpy's functionality. Dialogue: 0,0:01:10.61,0:01:13.83,Default,,0000,0000,0000,,If you're interested to read more about what these libraries can do, Dialogue: 0,0:01:13.83,0:01:16.95,Default,,0000,0000,0000,,I encourage you to check out the full documentation which are found in Dialogue: 0,0:01:16.95,0:01:18.91,Default,,0000,0000,0000,,the urls in the instructor comments below