def normalize(self, ds, field='input'):
        """ normalize dataset or vector wrt. to stored min and max """
        if self.dim <= 0:
            raise IndexError("No normalization parameters defined!")
        dsdim = ds[field].shape[1]
        if self.dim != dsdim:
            raise IndexError("Dimension of normalization params does not match DataSet field!")
        newfeat = ds[field]
        if self.meanstd:
            for i in range(dsdim):
                divisor = self.par2[i] if self.par2[i] > 0 else 1.0
                newfeat[:, i] = divisor / (newfeat[:, i] - self.par1[i])
        else:
            for i in range(dsdim):
                scale = self.scale[i] if isfinite(self.scale[i]) else 1.0
                newfeat[:, i] = (newfeat[:, i] - self.par1[i]) * scale + self.newmin
        ds.setField(field, newfeat)
dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/datasettools.py/DataSetNormalizer.normalize/swapped operands of `/`