Esempio n. 1
0
def generate_graphs():
    """Generate boxplots and histograms on years 2007 -> 2012.

    :return generates PNG plots in box_hist_output directory.
    """

    # Define our year interval container.
    years = [val for val in range(2007, 2013)]

    # For each year in our container.
    for year in years:

        # Initialize an InteractivePlot instance
        plot = InteractivePlot(year)

        # Plot both boxplot and histogram representations of the data.
        plot.interpret(plot_as='box')
        plot.interpret(plot_as='hist')
Esempio n. 2
0
def main():

    # Load initial data sets. (Q1, Q2, Q3)
    countries = read_countries()
    gapminder = read_gapminder(verbose=True)

    # Plot income distribution across population. (Q4)
    plot_income_distribution(2001)

    # Generate histogram of income distribution from year :year. (Q5)
    merge_by_year(2001)

    # Generate graphs of EDA class InteractivePlot. (Q6)
    plot = InteractivePlot(2002)
    plot.interpret(plot_as='box')
    plot.interpret(plot_as='hist')

    # Switch to read-eval-respond loop. (Q7)
    interactive_input()

    # Generate EDA graphs for years 2007, ..., 2012. (Q8)
    generate_graphs()
Esempio n. 3
0
def generate_graphs():
    """Generate boxplots and histograms on years 2007 -> 2012.

    :return generates PNG plots in box_hist_output directory.
    """

    # Define our year interval container.
    years = [val for val in range(2007, 2013)]

    # For each year in our container.
    for year in years:

        # Initialize an InteractivePlot instance
        plot = InteractivePlot(year)

        # Plot both boxplot and histogram representations of the data.
        plot.interpret(plot_as='box')
        plot.interpret(plot_as='hist')
Esempio n. 4
0
def main():

    # Load initial data sets. (Q1, Q2, Q3)
    countries = read_countries()
    gapminder = read_gapminder(verbose=True)

    # Plot income distribution across population. (Q4)
    plot_income_distribution(2001)

    # Generate histogram of income distribution from year :year. (Q5)
    merge_by_year(2001)

    # Generate graphs of EDA class InteractivePlot. (Q6)
    plot = InteractivePlot(2002)
    plot.interpret(plot_as='box')
    plot.interpret(plot_as='hist')

    # Switch to read-eval-respond loop. (Q7)
    interactive_input()

    # Generate EDA graphs for years 2007, ..., 2012. (Q8)
    generate_graphs()