get the residuals dataframe attribute

        Returns
        -------
        res : pandas.DataFrame

        Note
        ----
        if the Pst.__res attribute has not been loaded,
        this call loads the res dataframe from a file

def res(self):
        """get the residuals dataframe attribute

        Returns
        -------
        res : pandas.DataFrame

        Note
        ----
        if the Pst.__res attribute has not been loaded,
        this call loads the res dataframe from a file

        """
        if self.__res is not None:
            return self.__res
        else:
            if self.resfile is not None:
                assert os.path.exists(self.resfile),"Pst.res: self.resfile " +\
                    str(self.resfile) + " does not exist"
            else:
                self.resfile = self.filename.replace(".pst", ".res")
                if not os.path.exists(self.resfile):
                    self.resfile = self.resfile.replace(".res", ".rei")
                    if not os.path.exists(self.resfile):
                        self.resfile = self.resfile.replace(".rei", ".base.rei")
                        if not os.path.exists(self.resfile):
                            if self.new_filename is not None:
                                self.resfile = self.new_filename.replace(".pst",".res")
                                if not os.path.exists(self.resfile):
                                    self.resfile = self.resfile.replace(".res","rei")
                                    if not os.path.exists(self.resfile):
                                        raise Exception("Pst.res: " +
                                                        "could not residual file case.res" +
                                                        " or case.rei" + " or case.base.rei" +
                                                        " or case.obs.csv")


            res = pst_utils.read_resfile(self.resfile)
            missing_bool = self.observation_data.obsnme.apply\
                (lambda x: x not in res.name)
            missing = self.observation_data.obsnme[missing_bool]
            if missing.shape[0] > 0:
                raise Exception("Pst.res: the following observations " +
                                "were not found in " +
                                "{0}:{1}".format(self.resfile,','.join(missing)))
            self.__res = res
            return self.__res