99095d5412483ec623278bdb1a0c9e24b18bfc85,pdpipe/basic_stages.py,MapColVals,_op,#MapColVals#,497

Before Change


        inter_df = df
        source_column = df[self._column_name]
        if self._drop:
            inter_df = df.drop(self._column_name, axis=1)
        inter_df = df.assign(**{
            self._result_col_name: source_column.replace(self._value_map)
        })
        return inter_df

After Change



    def _op(self, df, verbose):
        inter_df = df
        for i, colname in enumerate(self._columns):
            source_col = df[colname]
            loc = df.columns.get_loc(colname) + 1
            new_name = self._result_columns[i]
            if self._drop:
                inter_df = inter_df.drop(colname, axis=1)
                loc -= 1
            inter_df = out_of_place_col_insert(
                df=inter_df,
                series=source_col.map(self._value_map),
                loc=loc,
                column_name=new_name)
        return inter_df


class Encode(PipelineStage):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


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


Project Name: cve-search/cve-search
Commit Name: 412e06fce467da87161cb535ba25c4234a0c3712
Time: 2014-10-02
Author: pieterjan.moreels@gmail.com
File Name: db_whitelist.py
Class Name:
Method Name:


Project Name: CNuge/kaggle-code
Commit Name: b7990885d8b26b9404fd9ce952b0b2f005019594
Time: 2018-01-12
Author: nugentc@uoguelph.ca
File Name: california_housing/feature_engineering.py
Class Name:
Method Name:


Project Name: pgmpy/pgmpy
Commit Name: ca337ebba627326cd7b15b454053e31f51b5e441
Time: 2015-06-16
Author: ankurankan@gmail.com
File Name: pgmpy/inference/Sampling.py
Class Name: BayesianModelSampling
Method Name: rejection_sample