46aea54b80a6f7516447a84b3d66d9502fe3834a,pdpipe/basic_stages.py,RowDrop,__init__,#RowDrop#Any#Any#Any#,457

Before Change


        if reduce is None:
            reduce = "any"
        self._reduce = reduce
        self._columns = None
        if columns:
            self._columns = _interpret_columns_param(columns)
        if reduce not in RowDrop._REDUCERS.keys():
            raise ValueError((
                "{} is an unsupported argument for the "reduce" parameter of "
                "the RowDrop constructor!").format(reduce))
        self._cond_is_dict = isinstance(conditions, dict)
        self._columns_str = ""
        if self._cond_is_dict:
            valid = all([callable(cond) for cond in conditions.values()])
            if not valid:
                raise ValueError(
                    "Condition dicts given to RowDrop must map to callables!")
            self._columns = list(conditions.keys())
            self._columns_str = _list_str(self._columns)
        else:
            valid = all([callable(cond) for cond in conditions])
            if not valid:
                raise ValueError(
                    "RowDrop condition lists can contain only callables!")
        self._row_cond = self._row_condition_builder(conditions, reduce)
        super_kwargs = {
            "exmsg": RowDrop._DEF_ROWDROP_EXC_MSG.format(self._columns_str),
            "appmsg": RowDrop._DEF_ROWDROP_APPLY_MSG.format(self._columns_str),
            "desc": self._default_desc()
        }
        super_kwargs.update(**kwargs)
        super().__init__(**super_kwargs)

    def _prec(self, df):

After Change


                raise ValueError(
                    "RowDrop condition lists can contain only callables!")
        self._row_cond = self._row_condition_builder(conditions, reduce)
        super_kwargs = {
            "columns": columns,
            "desc_temp": "Drop rows in columns {} by conditions",
        }
        super_kwargs.update(**kwargs)
        super_kwargs["none_columns"] = "all"
        super().__init__(**super_kwargs)

    def _transformation(self, df, verbose, fit):
        before_count = len(df)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 21

Instances


Project Name: shaypal5/pdpipe
Commit Name: 46aea54b80a6f7516447a84b3d66d9502fe3834a
Time: 2020-02-09
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: RowDrop
Method Name: __init__


Project Name: shaypal5/pdpipe
Commit Name: 46aea54b80a6f7516447a84b3d66d9502fe3834a
Time: 2020-02-09
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: RowDrop
Method Name: __init__


Project Name: shaypal5/pdpipe
Commit Name: a3e7204855a76e143a40073236c6254609f2303a
Time: 2020-02-05
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: ValDrop
Method Name: __init__


Project Name: shaypal5/pdpipe
Commit Name: 46aea54b80a6f7516447a84b3d66d9502fe3834a
Time: 2020-02-09
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: ValKeep
Method Name: __init__