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

Before Change



    def _op(self, df, verbose):
        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

    def __str__(self):
        return "Map values of column {}.".format(self._column_name)

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: 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: MapColVals
Method Name: _op


Project Name: keras-team/keras
Commit Name: b6d23b2e2dfc90480519ab52047006b1936fda02
Time: 2016-07-28
Author: jer.despraz@gmail.com
File Name: keras/backend/tensorflow_backend.py
Class Name:
Method Name: batch_set_value


Project Name: NervanaSystems/coach
Commit Name: b1e9ea48d86807382c5feca0d18a6bf71f5caa03
Time: 2019-01-03
Author: gouravr@amazon.com
File Name: rl_coach/architectures/tensorflow_components/savers.py
Class Name: GlobalVariableSaver
Method Name: __init__