3ab0e54a3ce88c7018a34192461dd47e5867d357,atlas/tables.py,,col_split,#Any#Any#Any#,48

Before Change


    indexes = list()
    new_values = list()
    df = df.dropna(subset=[column])
    for i, presplit in enumerate(df[column].astype(str)):
        for value in presplit.split(sep):
            indexes.append(i)
            new_values.append(value)
    new_df = df.iloc[indexes, :].copy()
    new_df[column] = new_values
    return new_df

After Change


    col_series = []
    for c in cols:
        col_series.append(df[c].str.split(sep, expand=True).stack().str.strip().reset_index(level=1, drop=True))
    temp_df = pd.concat(col_series, axis=1, keys=cols)
    return df.drop(cols, axis=1).join(temp_df).reset_index(drop=True)


def get_split_cols(df, values):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: metagenome-atlas/atlas
Commit Name: 3ab0e54a3ce88c7018a34192461dd47e5867d357
Time: 2017-01-28
Author: joe.brown@pnnl.gov
File Name: atlas/tables.py
Class Name:
Method Name: col_split


Project Name: etal/cnvkit
Commit Name: ec576f6724639d899e39664558c2cf0ddd052449
Time: 2015-11-18
Author: eric.talevich@gmail.com
File Name: cnvlib/export.py
Class Name:
Method Name: fmt_cdt


Project Name: dpressel/mead-baseline
Commit Name: 78eba7b3f82b8420deac3cd28318dbfead0f9b9e
Time: 2018-10-30
Author: dpressel@gmail.com
File Name: python/baseline/dy/seq2seq/model.py
Class Name: Seq2SeqModel
Method Name: decode