Esempio n. 1
0
def main():
    """ Main Function """
    HVGC = project.fill_missing_year(
        summed_platform_sales('Home Video Game Consoles'))
    HGC = project.fill_missing_year(
        summed_platform_sales('Handheld Game Consoles'))
    MW = project.fill_missing_year(summed_platform_sales('Microsoft Windows'))

    create_chart(HVGC, HGC, MW)
Esempio n. 2
0
def main():
    """ Main Function """
    data_frame = pandas.read_csv('vgsales.csv')
    NA_Sales = project.fill_missing_year(summed_sales(data_frame, 'NA_Sales'))
    EU_Sales = project.fill_missing_year(summed_sales(data_frame, 'EU_Sales'))
    JP_Sales = project.fill_missing_year(summed_sales(data_frame, 'JP_Sales'))
    OT_Sales = project.fill_missing_year(
        summed_sales(data_frame, 'Other_Sales'))
    GB_Sales = project.fill_missing_year(
        summed_sales(data_frame, 'Global_Sales'))
    create_chart(NA_Sales, EU_Sales, JP_Sales, OT_Sales, GB_Sales)
Esempio n. 3
0
def main():
    """ Main function """
    data_game = pandas.read_csv("vgsales.csv")
    data_year = numpy.array(
        data_game.groupby(["Genre", "Year"],
                          as_index=False).count()[["Genre", "Year",
                                                   "Rank"]]).tolist()
    data_genre = [
        i
        for i in (data_game.groupby(["Genre"], as_index=False).count()["Genre"]
                  ).tolist()
    ]

    chart = pygal.StackedLine(fill=True, interpolate='cubic', dots_size=1.75)
    chart.x_labels = range(1980, 2017)
    chart.x_labels_major_count = 8
    chart.show_minor_x_labels = False
    chart.y_labels = [i for i in range(0, 1601, 200)]
    chart.y_labels_major_every = 5
    chart.truncate_label = 5
    chart.legend_at_bottom = True
    chart.legend_box_size = 16
    chart.x_title = "Year"
    chart.y_title = "Video Games Amount"

    for i in data_genre:
        temp = project.fill_missing_year([[int(float(j[1])), j[2]]
                                          for j in data_year if j[0] == i])
        chart.add(i, [j[1] for j in temp])

    chart.render_to_file("releases_genre.svg")
Esempio n. 4
0
def main():
    """ Main function """
    df_change_platform = project.platform_convert_df(data_frame)
    game_type = [
        'Home Video Game Consoles', 'Handheld Game Consoles',
        'Microsoft Windows'
    ]
    game_in_years = numpy.array(
        data_frame.groupby('Year', as_index=False).count()[['Year',
                                                            'Rank']]).tolist()
    g_in_year = numpy.array(
        data_frame.groupby('Year', as_index=False).count()[['Year',
                                                            'Rank']]).tolist()

    for i in range(len(game_in_years)):
        if i == 0:
            continue
        else:
            game_in_years[i][1] += game_in_years[i - 1][1]

    game_in_years = project.fill_missing_year(game_in_years)

    amount_of_HVGC = pf_count_by_all('Home Video Game Consoles')
    amount_of_HHGC = pf_count_by_all('Handheld Game Consoles')
    amount_of_MSW = pf_count_by_all('Microsoft Windows')

    create_chart(amount_of_HVGC, amount_of_HHGC, amount_of_MSW)
def main():
    """create chart platform type of games count in each year """
    data_game = pandas.read_csv('vgsales.csv')
    data_game = pj.platform_convert_df(data_game)
    data_Year = numpy.array(
        data_game.groupby(["Platform", "Year"],
                          as_index=False).count()[["Platform", "Year",
                                                   "Rank"]]).tolist()
    data_platform = [
        i for i in (data_game.groupby(["Platform"], as_index=False).count()
                    ["Platform"]).tolist()
    ]
    overall = numpy.array(
        data_game.groupby(["Year"],
                          as_index=False).count()[["Year", "Name"]]).tolist()
    yearss = numpy.array(
        data_game.groupby(["Year"], as_index=False).count()["Year"]).tolist()
    data_Year1 = pj.fill_missing_year(overall)
    value = []

    for i in data_Year1:
        value.append(i[1])

    chart = pygal.StackedLine(fill=True, interpolate='cubic', dots_size=1.75)
    chart.x_labels = range(1980, 2017)
    chart.x_labels_major_count = 8
    chart.show_minor_x_labels = False
    chart.truncate_label = 5
    chart.y_labels = [i for i in range(0, 1601, 200)]
    chart.y_labels_major_every = 5
    chart.legend_at_bottom = True
    chart.legend_at_bottom_columns = 3
    chart.legend_box_size = 16
    chart.x_title = "Year"
    chart.y_title = "Video Games Amount"

    for i in [
            'Home Video Game Consoles', 'Handheld Game Consoles',
            'Microsoft Windows'
    ]:
        temp = pj.fill_missing_year([[j[1], j[2]] for j in data_Year
                                     if j[0] == i])
        chart.add(i, [j[1] for j in temp])

    chart.render_to_file("releases_platform.svg")
Esempio n. 6
0
def main():
    """ Main Function """
    action = project.fill_missing_year(summed_genre_sales('Action'))
    adventure = project.fill_missing_year(summed_genre_sales('Adventure'))
    figthing = project.fill_missing_year(summed_genre_sales('Fighting'))
    misc = project.fill_missing_year(summed_genre_sales('Misc'))
    platform = project.fill_missing_year(summed_genre_sales('Platform'))
    puzzle = project.fill_missing_year(summed_genre_sales('Puzzle'))
    racing = project.fill_missing_year(summed_genre_sales('Racing'))
    role_playing = project.fill_missing_year(summed_genre_sales('Role-Playing'))
    shooter = project.fill_missing_year(summed_genre_sales('Shooter'))
    simulation = project.fill_missing_year(summed_genre_sales('Simulation'))
    sports = project.fill_missing_year(summed_genre_sales('Sports'))
    strategy = project.fill_missing_year(summed_genre_sales('Strategy'))
    create_chart(action, adventure, figthing, misc, platform, puzzle, racing, role_playing, shooter, simulation, sports, strategy)