8ab31ccce5629d57ad6ca671a90c39d54fdda568,pudl/helpers.py,,simplify_columns,#Any#,400

Before Change


     - Stripping leading and trailing whitespace.
    
    df.columns = df.columns.str.replace("[^0-9a-zA-Z]+", " ")
    df.columns = df.columns.str.strip().str.lower().str.replace(r"\s+", " ")
    df.columns = df.columns.str.replace(" ", "_")
    return df

After Change


     - Compacting internal whitespace.
     - Stripping leading and trailing whitespace.
    
    df.columns = (
        df.columns.str
          .replace("[^0-9a-zA-Z]+", " ").str
          .strip().str
          .lower().str
          .replace(r"\s+", " ").str
          .replace(" ", "_")
    )
    return df
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: catalyst-cooperative/pudl
Commit Name: 8ab31ccce5629d57ad6ca671a90c39d54fdda568
Time: 2019-01-02
Author: cgosnell@catalyst.coop
File Name: pudl/helpers.py
Class Name:
Method Name: simplify_columns


Project Name: catalyst-cooperative/pudl
Commit Name: e1082d619ca1c644c6e3d9fefeef781935949707
Time: 2018-12-22
Author: zane.selvans@catalyst.coop
File Name: pudl/helpers.py
Class Name:
Method Name: simplify_columns


Project Name: cuemacro/finmarketpy
Commit Name: 2469eecd6a94184881967f0aee19d1cbf89b22e7
Time: 2016-07-28
Author: saeedamen@hotmail.com
File Name: pythalesians/market/loaders/lowlevel/quandl/loaderquandl.py
Class Name: LoaderQuandl
Method Name: load_ticker