99095d5412483ec623278bdb1a0c9e24b18bfc85,pdpipe/basic_stages.py,Bin,_op,#Bin#Any#Any#,324

Before Change


        return _col_binner

    def _op(self, df, verbose):
        assign_map = {}
        colnames = list(self._bin_map.keys())
        if verbose:
            colnames = tqdm.tqdm(colnames)
        for colname in colnames:
            assign_map[colname+"_binned"] = df[colname].apply(
                self._get_col_binner(self._bin_map[colname]))
        inter_df = df.assign(**assign_map)
        if self._drop:
            return inter_df.drop(list(self._bin_map.keys()), axis=1)
        return inter_df

    def __str__(self):
        string = ""

After Change


            if verbose:
                colnames.set_description(colname)
            source_col = df[colname]
            loc = df.columns.get_loc(colname) + 1
            new_name = colname + "_bin"
            if self._drop:
                inter_df = inter_df.drop(colname, axis=1)
                new_name = colname
                loc -= 1
            inter_df = out_of_place_col_insert(
                df=inter_df,
                series=source_col.apply(
                    self._get_col_binner(self._bin_map[colname])),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: shaypal5/pdpipe
Commit Name: 99095d5412483ec623278bdb1a0c9e24b18bfc85
Time: 2017-03-16
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: Bin
Method Name: _op


Project Name: shaypal5/pdpipe
Commit Name: 99095d5412483ec623278bdb1a0c9e24b18bfc85
Time: 2017-03-16
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: Encode
Method Name: _op


Project Name: commonsense/conceptnet5
Commit Name: b269b5dadd538b918b86efbc9b791d0baa855563
Time: 2017-04-10
Author: rob@luminoso.com
File Name: conceptnet5/vectors/query.py
Class Name: VectorSpaceWrapper
Method Name: index_prefix_range