dataremover.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:scikit-discovery 作者: MITHaystack 项目源码 文件源码
def process(self, obj_data):
        ''' 
        NaN's data from DataWrapper

        @param obj_data: Input DataWrapper, which will be modified in place
        '''

        labels = self.labels
        column_names = self.column_names

        for label, data, err in obj_data.getIterator():
            if (labels is None or label in labels) and \
               (column_names is None or data.name in column_names):

                index = data.index

                if self.start is None:
                    start = index[0]
                else:
                    start = self.start

                if self.end is None:
                    end = index[-1]
                else:
                    end = self.end

                new_nans = np.empty(len(data[start:end]))
                new_nans[:] = np.NAN
                new_nans = pd.Series(new_nans, index=data[start:end].index)

                data.loc[start:end] = new_nans
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号