Пример #1
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)
Пример #2
0
def summed_platform_sales(genre):
    """ This Function for Summed Sales of Years in Zone """
    data_frame_convert = project.platform_convert_df(data_frame)
    genre_sales = []
    all_genre_list = numpy.array(
        data_frame.groupby(['Year', 'Platform'], as_index=False).sum()[[
            'Year', 'Platform', 'Global_Sales'
        ]]).tolist()
    for i in all_genre_list:
        selected = [i[0], i[2]]
        if i[1] == genre:
            genre_sales.append(selected)
    return genre_sales
Пример #3
0
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")
Пример #4
0
def main():
    """ Main function """
    data_frame = project.platform_convert_df(pandas.read_csv('vgsales.csv'))
    create_chart(data_frame)
Пример #5
0
"""
    PSIT Data Analysis Project
    Chart: Growth of Video Games Amount
    by Supakit Theanthunyakit (POKINBKK)
"""

import pandas, numpy, pygal
from pygal.style import CleanStyle
from project_module import project

data_frame = pandas.read_csv('vgsales.csv')
df_change_platform = project.platform_convert_df(data_frame)
year_pf_list = numpy.array(df_change_platform[['Year', 'Platform']]).tolist()


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: