src/ei_mcoe/ei_mcoe.py
def merge_ferc1_eia_mcoe_factors(eia_fuel_df, ferc_fuel_df):
    """Produce final EIA and FERC Form 1 merge and calculate MCOE value.

    This function combines the FERC Form 1 data, now disaggregated by plant and
    fuel type, with EIA data aggregated in the same manner. It then runs
    calculations to add columns for mcoe and rearanges/renames columns for
    the desired output.

    Args:
        eia_fuel_df (pandas.DataFrame): A DataFrame with EIA data broken
            down by plant and fuel type.
        ferc_fuel_df (pandas.DataFrame): A DataFrame with FERC Form 1 data
            broken down by plant and fuel type.

    Returns:
        pandas.DataFrame: A DataFrame with EIA and FERC Form 1 data broken
            down by plant and fuel type. MCOE values calculated.
    """
    logger.info(' - Merging FERC and EIA mcoe data on plant and fuel type')
    # Merge FERC1 and EIA923 on plant, fuel, and year using prep_plant_fuel_
    # data_eia() output associated with key 'plant_fuel_ag'
    eia_ferc_merge_df = (
        pd.merge(eia_fuel_df, ferc_fuel_df,
                 on=input_dict['plant-fuel_index_cols'], how='outer',
                 suffixes=("", "_ferc1"))
        .assign(
            fuel_cost_mwh_eia923=lambda x: (x.total_fuel_cost /
                                            x.net_generation_mwh),
            fix_var_om_mwh=lambda x: x.opex_nofuel / x.net_generation_mwh_ferc1
        )
        .rename(columns={'opex_nofuel': 'fix_var_om'}))
    return eia_ferc_merge_df
Produce final EIA and FERC Form 1 merge and calculate MCOE value.

    This function combines the FERC Form 1 data, now disaggregated by plant and
    fuel type, with EIA data aggregated in the same manner. It then runs
    calculations to add columns for mcoe and rearanges/renames columns for
    the desired output.

    Args:
        eia_fuel_df (pandas.DataFrame): A DataFrame with EIA data broken
            down by plant and fuel type.
        ferc_fuel_df (pandas.DataFrame): A DataFrame with FERC Form 1 data
            broken down by plant and fuel type.

    Returns:
        pandas.DataFrame: A DataFrame with EIA and FERC Form 1 data broken
            down by plant and fuel type. MCOE values calculated.
    
Produce final EIA and FERC Form 1 merge and calculate MCOE value.
This function combines the FERC Form 1 data, now disaggregated by plant and
fuel type, with EIA data aggregated in the same manner. It then runs
calculations to add columns for mcoe and rearanges/renames columns for
the desired output.
Produce final EIA and FERC Form 1 merge and calculate MCOE value . This function combines the FERC Form 1 data now disaggregated by plant and fuel type with EIA data aggregated in the same manner . It then runs calculations to add columns for mcoe and rearanges / renames columns for the desired output .
def merge_ferc1_eia_mcoe_factors(eia_fuel_df, ferc_fuel_df):
    logger.info(' - Merging FERC and EIA mcoe data on plant and fuel type')
    eia_ferc_merge_df = (
        pd.merge(eia_fuel_df, ferc_fuel_df,
                 on=input_dict['plant-fuel_index_cols'], how='outer',
                 suffixes=("", "_ferc1"))
        .assign(
            fuel_cost_mwh_eia923=lambda x: (x.total_fuel_cost /
                                            x.net_generation_mwh),
            fix_var_om_mwh=lambda x: x.opex_nofuel / x.net_generation_mwh_ferc1
        )
        .rename(columns={'opex_nofuel': 'fix_var_om'}))
    return eia_ferc_merge_df
def merge_ferc1_eia_mcoe_factors ( eia_fuel_df , ferc_fuel_df ) : logger . info ( ' - Merging FERC and EIA mcoe data on plant and fuel type' ) eia_ferc_merge_df = ( pd . merge ( eia_fuel_df , ferc_fuel_df , on = input_dict [ 'plant-fuel_index_cols' ] , how = 'outer' , suffixes = ( "" , "_ferc1" ) ) . assign ( fuel_cost_mwh_eia923 = lambda x : ( x . total_fuel_cost / x . net_generation_mwh ) , fix_var_om_mwh = lambda x : x . opex_nofuel / x . net_generation_mwh_ferc1 ) . rename ( columns = { 'opex_nofuel' : 'fix_var_om' } ) ) return eia_ferc_merge_df
Produce final EIA and FERC Form 1 merge and calculate MCOE value.
Produce final EIA and FERC Form 1 merge and calculate MCOE value .
"""Produce final EIA and FERC Form 1 merge and calculate MCOE value.

    This function combines the FERC Form 1 data, now disaggregated by plant and
    fuel type, with EIA data aggregated in the same manner. It then runs
    calculations to add columns for mcoe and rearanges/renames columns for
    the desired output.

    Args:
        eia_fuel_df (pandas.DataFrame): A DataFrame with EIA data broken
            down by plant and fuel type.
        ferc_fuel_df (pandas.DataFrame): A DataFrame with FERC Form 1 data
            broken down by plant and fuel type.

    Returns:
        pandas.DataFrame: A DataFrame with EIA and FERC Form 1 data broken
            down by plant and fuel type. MCOE values calculated.
    """ # Merge FERC1 and EIA923 on plant, fuel, and year using prep_plant_fuel_ # data_eia() output associated with key 'plant_fuel_ag'
A DataFrame with EIA and FERC Form 1 data broken
down by plant and fuel type. MCOE values calculated.
A DataFrame with EIA and FERC Form 1 data broken down by plant and fuel type . MCOE values calculated .
pandas.DataFrame
eia_fuel_df
A DataFrame with EIA data broken
down by plant and fuel type.
A DataFrame with EIA data broken down by plant and fuel type .
ferc_fuel_df
A DataFrame with FERC Form 1 data
broken down by plant and fuel type.
A DataFrame with FERC Form 1 data broken down by plant and fuel type .