def read_resfile(resfile):
        """load a residual file into a pandas.DataFrame

        Parameters
        ----------
        resfile : str
            residual file name

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

        """
        assert os.path.exists(resfile),"read_resfile() error: resfile " +\
                                       "{0} not found".format(resfile)
        converters = {"name": str_con, "group": str_con}
        f = open(resfile, 'r')
        while True:
            line = f.readline()
            if line == '':
                raise Exception("Pst.get_residuals: EOF before finding "+
                                "header in resfile: " + resfile)
            if "name" in line.lower():
                header = line.lower().strip().split()
                break
        res_df = pd.read_csv(f, header=None, names=header, sep="\s+",
                                 converters=converters)
        res_df.index = res_df.name
        f.close()
        return res_df
def read_resfile ( resfile ) : assert os . path . exists ( resfile ) , "read_resfile() error: resfile " + "{0} not found" . format ( resfile ) converters = { "name" : str_con , "group" : str_con } f = open ( resfile , 'r' ) while True : line = f . readline ( ) if line == '' : raise Exception ( "Pst.get_residuals: EOF before finding " + "header in resfile: " + resfile ) if "name" in line . lower ( ) : header = line . lower ( ) . strip ( ) . split ( ) break res_df = pd . read_csv ( f , header = None , names = header , sep = "\s+" , converters = converters ) res_df . index = res_df . name f . close ( ) return res_df
load a residual file into a pandas.DataFrame

        Parameters
        ----------
        resfile : str
            residual file name

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