def _store_unsorted_results(self, smooth, residual):
        """Convert sorted smooth/residual back to as-input order."""
        if self._original_index_of_xvalue:
            # data was sorted. Unsort it here.
            self.smooth_result = numpy.zeros(len(self.y))
            self.cross_validated_residual = numpy.zeros(len(residual))
            original_x = numpy.zeros(len(self.y))
            for i, (xval, smooth_val, residual_val) in enumerate(zip(self.x, smooth, residual)):
                original_index = self._original_index_of_xvalue[i]
                original_x[original_index] = xval
                self.smooth_result[original_index] = smooth_val
                self.cross_validated_residual[original_index] = residual_val
                self.x = original_x
        else:
            # no sorting was done. just apply results
            self.smooth_result = smooth
            self.cross_validated_residual = residual
def _store_unsorted_results ( self , smooth , residual ) : if self . _original_index_of_xvalue : self . smooth_result = numpy . zeros ( len ( self . y ) ) self . cross_validated_residual = numpy . zeros ( len ( residual ) ) original_x = numpy . zeros ( len ( self . y ) ) for i , ( xval , smooth_val , residual_val ) in enumerate ( zip ( self . x , smooth , residual ) ) : original_index = self . _original_index_of_xvalue [ i ] original_x [ original_index ] = xval self . smooth_result [ original_index ] = smooth_val self . cross_validated_residual [ original_index ] = residual_val self . x = original_x else : self . smooth_result = smooth self . cross_validated_residual = residual
Convert sorted smooth/residual back to as-input order.