src/ei_mcoe/ei_mcoe.py
def fuel_type_to_col_eia(eia_plant_fuel_df, col):
    """Make fuel type row values into columns.

    Reorient dataframe by plant so that fuel type percentages are columns
    rather than row values. Used for merging with FERC Form 1 data. The
    output DataFrame is ready to merge with another DataFrame from this output
    with a different 'col' specified. It is also ready to merge with FERC Form
    1 plant level data to perform fuel level disagregation.

    Args:
        eia_plant_fuel_df (pandas.DataFrame): A DataFrame with eia fuel type
            percent values as rows.
        col (str): The name of the percent value column (such as
            'capacity_mw' or 'net_generation_mwh') that will be reoriented
            to suit the calculation of fuel type breakdown of FERC Form 1
            data.

    Returns:
        pandas.DataFrame: A DataFrame with the fuel type percent values
            as columns rather than rows.
    """
    logger.info('Turning eia fuel percent values for ' + col + ' into columns')
    pcts_as_cols_df = (
        eia_plant_fuel_df.pivot_table(
            'pct_' + col, input_dict['plant_index_cols'],
            'fuel_type_code_pudl')
        .reset_index()
        .rename(columns={'coal': 'pct_' + col + '_coal',
                         'gas': 'pct_' + col + '_gas',
                         'oil': 'pct_' + col + '_oil',
                         'waste': 'pct_' + col + '_waste'}))
    return pcts_as_cols_df
Make fuel type row values into columns.

    Reorient dataframe by plant so that fuel type percentages are columns
    rather than row values. Used for merging with FERC Form 1 data. The
    output DataFrame is ready to merge with another DataFrame from this output
    with a different 'col' specified. It is also ready to merge with FERC Form
    1 plant level data to perform fuel level disagregation.

    Args:
        eia_plant_fuel_df (pandas.DataFrame): A DataFrame with eia fuel type
            percent values as rows.
        col (str): The name of the percent value column (such as
            'capacity_mw' or 'net_generation_mwh') that will be reoriented
            to suit the calculation of fuel type breakdown of FERC Form 1
            data.

    Returns:
        pandas.DataFrame: A DataFrame with the fuel type percent values
            as columns rather than rows.
    
Make fuel type row values into columns.
Reorient dataframe by plant so that fuel type percentages are columns
rather than row values. Used for merging with FERC Form 1 data. The
output DataFrame is ready to merge with another DataFrame from this output
with a different 'col' specified. It is also ready to merge with FERC Form
1 plant level data to perform fuel level disagregation.
Make fuel type row values into columns . Reorient dataframe by plant so that fuel type percentages are columns rather than row values . Used for merging with FERC Form 1 data . The output DataFrame is ready to merge with another DataFrame from this output with a different ' col ' specified . It is also ready to merge with FERC Form 1 plant level data to perform fuel level disagregation .
def fuel_type_to_col_eia(eia_plant_fuel_df, col):
    logger.info('Turning eia fuel percent values for ' + col + ' into columns')
    pcts_as_cols_df = (
        eia_plant_fuel_df.pivot_table(
            'pct_' + col, input_dict['plant_index_cols'],
            'fuel_type_code_pudl')
        .reset_index()
        .rename(columns={'coal': 'pct_' + col + '_coal',
                         'gas': 'pct_' + col + '_gas',
                         'oil': 'pct_' + col + '_oil',
                         'waste': 'pct_' + col + '_waste'}))
    return pcts_as_cols_df
def fuel_type_to_col_eia ( eia_plant_fuel_df , col ) : logger . info ( 'Turning eia fuel percent values for ' + col + ' into columns' ) pcts_as_cols_df = ( eia_plant_fuel_df . pivot_table ( 'pct_' + col , input_dict [ 'plant_index_cols' ] , 'fuel_type_code_pudl' ) . reset_index ( ) . rename ( columns = { 'coal' : 'pct_' + col + '_coal' , 'gas' : 'pct_' + col + '_gas' , 'oil' : 'pct_' + col + '_oil' , 'waste' : 'pct_' + col + '_waste' } ) ) return pcts_as_cols_df
Make fuel type row values into columns.
Make fuel type row values into columns .
"""Make fuel type row values into columns.

    Reorient dataframe by plant so that fuel type percentages are columns
    rather than row values. Used for merging with FERC Form 1 data. The
    output DataFrame is ready to merge with another DataFrame from this output
    with a different 'col' specified. It is also ready to merge with FERC Form
    1 plant level data to perform fuel level disagregation.

    Args:
        eia_plant_fuel_df (pandas.DataFrame): A DataFrame with eia fuel type
            percent values as rows.
        col (str): The name of the percent value column (such as
            'capacity_mw' or 'net_generation_mwh') that will be reoriented
            to suit the calculation of fuel type breakdown of FERC Form 1
            data.

    Returns:
        pandas.DataFrame: A DataFrame with the fuel type percent values
            as columns rather than rows.
    """
A DataFrame with the fuel type percent values
as columns rather than rows.
A DataFrame with the fuel type percent values as columns rather than rows .
pandas.DataFrame
eia_plant_fuel_df
A DataFrame with eia fuel type
percent values as rows.
A DataFrame with eia fuel type percent values as rows .
col
The name of the percent value column (such as
'capacity_mw' or 'net_generation_mwh') that will be reoriented
to suit the calculation of fuel type breakdown of FERC Form 1
data.
The name of the percent value column ( such as ' capacity_mw ' or ' net_generation_mwh ' ) that will be reoriented to suit the calculation of fuel type breakdown of FERC Form 1 data .