ee46896718702e6420fd937ea2ff8a9db026b0da,pudl/transform/ferc1.py,,plants_hydro,#Any#Any#,527

Before Change



    // Standardize plant_name capitalization and remove leading/trailing white
    // space -- necesary b/c plant_name is part of many foreign keys.
    ferc1_hydro_df["plant_name"] = ferc1_hydro_df["plant_name"].str.strip()
    ferc1_hydro_df["plant_name"] = ferc1_hydro_df["plant_name"].str.title()

    // Converting kWh to MWh
    ferc1_hydro_df["net_generation_mwh"] = \
        ferc1_hydro_df["net_generation"] / 1000.0
    ferc1_hydro_df.drop("net_generation", axis=1, inplace=True)
    // Converting cost per kW installed to cost per MW installed:
    ferc1_hydro_df["cost_per_mw"] = ferc1_hydro_df["cost_per_kw"] * 1000.0
    ferc1_hydro_df.drop("cost_per_kw", axis=1, inplace=True)
    // Converting kWh to MWh
    ferc1_hydro_df["expns_per_mwh"] = ferc1_hydro_df["expns_kwh"] * 1000.0
    ferc1_hydro_df.drop("expns_kwh", axis=1, inplace=True)

    ferc1_hydro_df["yr_const"] = pd.to_numeric(
        ferc1_hydro_df["yr_const"],
        errors="coerce")
    ferc1_hydro_df["yr_installed"] = pd.to_numeric(
        ferc1_hydro_df["yr_installed"],
        errors="coerce")
    ferc1_hydro_df.dropna(inplace=True)

After Change


    Returns: transformed dataframe.
    
    // grab table from dictionary of dfs
    ferc1_hydro_df = _clean_cols(ferc1_raw_dfs["plants_hydro_ferc1"])

    // Standardize plant_name capitalization and remove leading/trailing white
    // space -- necesary b/c plant_name is part of many foreign keys.
    ferc1_hydro_df = pudl.helpers.strip_lower(ferc1_hydro_df, ["plant_name"])

    // Converting kWh to MWh
    ferc1_hydro_df["net_generation_mwh"] = \
        ferc1_hydro_df["net_generation"] / 1000.0
    ferc1_hydro_df.drop("net_generation", axis=1, inplace=True)
    // Converting cost per kW installed to cost per MW installed:
    ferc1_hydro_df["cost_per_mw"] = ferc1_hydro_df["cost_per_kw"] * 1000.0
    ferc1_hydro_df.drop("cost_per_kw", axis=1, inplace=True)
    // Converting kWh to MWh
    ferc1_hydro_df["expns_per_mwh"] = ferc1_hydro_df["expns_kwh"] * 1000.0
    ferc1_hydro_df.drop("expns_kwh", axis=1, inplace=True)

    ferc1_hydro_df["yr_const"] = pd.to_numeric(
        ferc1_hydro_df["yr_const"],
        errors="coerce")
    ferc1_hydro_df["yr_installed"] = pd.to_numeric(
        ferc1_hydro_df["yr_installed"],
        errors="coerce")
    ferc1_hydro_df.dropna(inplace=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 22

Instances


Project Name: catalyst-cooperative/pudl
Commit Name: ee46896718702e6420fd937ea2ff8a9db026b0da
Time: 2018-10-18
Author: zane.selvans@catalyst.coop
File Name: pudl/transform/ferc1.py
Class Name:
Method Name: plants_hydro


Project Name: catalyst-cooperative/pudl
Commit Name: ee46896718702e6420fd937ea2ff8a9db026b0da
Time: 2018-10-18
Author: zane.selvans@catalyst.coop
File Name: pudl/transform/ferc1.py
Class Name:
Method Name: plants_hydro


Project Name: catalyst-cooperative/pudl
Commit Name: ee46896718702e6420fd937ea2ff8a9db026b0da
Time: 2018-10-18
Author: zane.selvans@catalyst.coop
File Name: pudl/transform/ferc1.py
Class Name:
Method Name: plants_pumped_storage


Project Name: catalyst-cooperative/pudl
Commit Name: ee46896718702e6420fd937ea2ff8a9db026b0da
Time: 2018-10-18
Author: zane.selvans@catalyst.coop
File Name: pudl/transform/ferc1.py
Class Name:
Method Name: plants_small