import numpy as np
import pandas as pd


def numpy_dot():
    '''
    Imagine a point system in which each country is awarded 4 points for each
    gold medal,  2 points for each silver medal, and one point for each
    bronze medal.

    Using the numpy.dot function, create a new dataframe called
    'olympic_points_df' that includes:
        a) a column called 'country_name' with the country name
        b) a column called 'points' with the total number of points the country
           earned at the Sochi olympics.

    You do not need to call the function in your code when running it in the
    browser - the grader will do that automatically when you submit or test it.
    '''

    countries = [
        'Russian Fed.', 'Norway', 'Canada', 'United States', 'Netherlands',
        'Germany', 'Switzerland', 'Belarus', 'Austria', 'France', 'Poland',
        'China', 'Korea', 'Sweden', 'Czech Republic', 'Slovenia', 'Japan',
        'Finland', 'Great Britain', 'Ukraine', 'Slovakia', 'Italy', 'Latvia',
        'Australia', 'Croatia', 'Kazakhstan'
    ]

    gold = [
        13, 11, 10, 9, 8, 8, 6, 5, 4, 4, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0,
        0, 0, 0
    ]
    silver = [
        11, 5, 10, 7, 7, 6, 3, 0, 8, 4, 1, 4, 3, 7, 4, 2, 4, 3, 1, 0, 0, 2, 2,
        2, 1, 0
    ]
    bronze = [
        9, 10, 5, 12, 9, 5, 2, 1, 5, 7, 1, 2, 2, 6, 2, 4, 3, 1, 2, 1, 0, 6, 2,
        1, 0, 1
    ]

    # YOUR CODE HERE
    olympic_medal_counts = {
        'country_name':
        pd.Series(countries),
        'points':
        pd.Series(
            np.dot(np.array([gold, silver, bronze]).T, np.array([4, 2, 1])))
    }

    olympic_points_df = pd.DataFrame(olympic_medal_counts)
    return olympic_points_df


res = numpy_dot()
print res
