src/ei_mcoe/ei_mcoe.py
def plot_fuel_pct_check(df):
    """Create histograms to compare EIA and FERC Form 1 fuel percents.

    Args:
        df (pandas.DataFrame): A DataFrame with merged FERC Form 1 and EIA fuel
            percents. Product of the merge_ferc1_eia_fuel_pcts() function.

    Returns:
        histogram: A histogram depicting the differnce between EIA fuel percent
            breakdown at the plant and fuel level with FERC Form 1 fuel mmbtu
            fraction and fuel cost fraction.
    """
    fig, (net_gen_ax, cost_ax) = plt.subplots(ncols=2, nrows=1,
                                              figsize=(17, 8))
    xlabel = "EIA / FERC Form 1"
    cost_range = (0, 3)
    nbins = 20
    pdf = True

    x_coal_mmbtu = df.coal_fraction_mmbtu_eia / df.coal_fraction_mmbtu_ferc1
    x_gas_mmbtu = df.gas_fraction_mmbtu_eia / df.gas_fraction_mmbtu_ferc1
    x_coal_cost = df.coal_fraction_mmbtu_eia / df.coal_fraction_cost
    x_gas_cost = df.gas_fraction_mmbtu_eia / df.gas_fraction_cost

    net_gen_ax.hist([x_coal_mmbtu, x_gas_mmbtu],
                    histtype='bar',
                    range=cost_range,
                    bins=nbins,
                    # weights=df.coal_fraction_mmbtu_ferc1,
                    label=['Coal', 'Gas'],
                    density=pdf,
                    color=['black', 'blue'],
                    alpha=0.5)
    net_gen_ax.set_title('EIA / FERC Form 1 mmbtu Fractions')
    net_gen_ax.legend()

    cost_ax.hist([x_coal_cost, x_gas_cost],
                 range=cost_range,
                 bins=nbins,
                 # weights=eia_coal_plants.net_generation_mwh,
                 label=['Coal', 'Gas'],
                 density=pdf,
                 color=['black', 'blue'],
                 alpha=0.5)
    cost_ax.set_xlabel(xlabel)
    cost_ax.set_title('EIA / FERC Form 1 Cost Fractions')
    cost_ax.legend()
    # plt.savefig("ferc1_eia_fuel_pct_check.png")
    plt.tight_layout()
    plt.show()
Create histograms to compare EIA and FERC Form 1 fuel percents.

    Args:
        df (pandas.DataFrame): A DataFrame with merged FERC Form 1 and EIA fuel
            percents. Product of the merge_ferc1_eia_fuel_pcts() function.

    Returns:
        histogram: A histogram depicting the differnce between EIA fuel percent
            breakdown at the plant and fuel level with FERC Form 1 fuel mmbtu
            fraction and fuel cost fraction.
    
Create histograms to compare EIA and FERC Form 1 fuel percents.
Create histograms to compare EIA and FERC Form 1 fuel percents .
def plot_fuel_pct_check(df):
    fig, (net_gen_ax, cost_ax) = plt.subplots(ncols=2, nrows=1,
                                              figsize=(17, 8))
    xlabel = "EIA / FERC Form 1"
    cost_range = (0, 3)
    nbins = 20
    pdf = True
    x_coal_mmbtu = df.coal_fraction_mmbtu_eia / df.coal_fraction_mmbtu_ferc1
    x_gas_mmbtu = df.gas_fraction_mmbtu_eia / df.gas_fraction_mmbtu_ferc1
    x_coal_cost = df.coal_fraction_mmbtu_eia / df.coal_fraction_cost
    x_gas_cost = df.gas_fraction_mmbtu_eia / df.gas_fraction_cost
    net_gen_ax.hist([x_coal_mmbtu, x_gas_mmbtu],
                    histtype='bar',
                    range=cost_range,
                    bins=nbins,
                    label=['Coal', 'Gas'],
                    density=pdf,
                    color=['black', 'blue'],
                    alpha=0.5)
    net_gen_ax.set_title('EIA / FERC Form 1 mmbtu Fractions')
    net_gen_ax.legend()
    cost_ax.hist([x_coal_cost, x_gas_cost],
                 range=cost_range,
                 bins=nbins,
                 label=['Coal', 'Gas'],
                 density=pdf,
                 color=['black', 'blue'],
                 alpha=0.5)
    cost_ax.set_xlabel(xlabel)
    cost_ax.set_title('EIA / FERC Form 1 Cost Fractions')
    cost_ax.legend()
    plt.tight_layout()
    plt.show()
def plot_fuel_pct_check ( df ) : fig , ( net_gen_ax , cost_ax ) = plt . subplots ( ncols = 2 , nrows = 1 , figsize = ( 17 , 8 ) ) xlabel = "EIA / FERC Form 1" cost_range = ( 0 , 3 ) nbins = 20 pdf = True x_coal_mmbtu = df . coal_fraction_mmbtu_eia / df . coal_fraction_mmbtu_ferc1 x_gas_mmbtu = df . gas_fraction_mmbtu_eia / df . gas_fraction_mmbtu_ferc1 x_coal_cost = df . coal_fraction_mmbtu_eia / df . coal_fraction_cost x_gas_cost = df . gas_fraction_mmbtu_eia / df . gas_fraction_cost net_gen_ax . hist ( [ x_coal_mmbtu , x_gas_mmbtu ] , histtype = 'bar' , range = cost_range , bins = nbins , label = [ 'Coal' , 'Gas' ] , density = pdf , color = [ 'black' , 'blue' ] , alpha = 0.5 ) net_gen_ax . set_title ( 'EIA / FERC Form 1 mmbtu Fractions' ) net_gen_ax . legend ( ) cost_ax . hist ( [ x_coal_cost , x_gas_cost ] , range = cost_range , bins = nbins , label = [ 'Coal' , 'Gas' ] , density = pdf , color = [ 'black' , 'blue' ] , alpha = 0.5 ) cost_ax . set_xlabel ( xlabel ) cost_ax . set_title ( 'EIA / FERC Form 1 Cost Fractions' ) cost_ax . legend ( ) plt . tight_layout ( ) plt . show ( )
Create histograms to compare EIA and FERC Form 1 fuel percents.
Create histograms to compare EIA and FERC Form 1 fuel percents .
"""Create histograms to compare EIA and FERC Form 1 fuel percents.

    Args:
        df (pandas.DataFrame): A DataFrame with merged FERC Form 1 and EIA fuel
            percents. Product of the merge_ferc1_eia_fuel_pcts() function.

    Returns:
        histogram: A histogram depicting the differnce between EIA fuel percent
            breakdown at the plant and fuel level with FERC Form 1 fuel mmbtu
            fraction and fuel cost fraction.
    """ # weights=df.coal_fraction_mmbtu_ferc1, # weights=eia_coal_plants.net_generation_mwh, # plt.savefig("ferc1_eia_fuel_pct_check.png")
A histogram depicting the differnce between EIA fuel percent
breakdown at the plant and fuel level with FERC Form 1 fuel mmbtu
fraction and fuel cost fraction.
A histogram depicting the differnce between EIA fuel percent breakdown at the plant and fuel level with FERC Form 1 fuel mmbtu fraction and fuel cost fraction .
histogram
df
A DataFrame with merged FERC Form 1 and EIA fuel
percents. Product of the merge_ferc1_eia_fuel_pcts() function.
A DataFrame with merged FERC Form 1 and EIA fuel percents . Product of the merge_ferc1_eia_fuel_pcts () function .