def histogram(self, idx=None, critval=None):
        '''calculate histogram values

        does not do any plotting

        I don't remember what I wanted here, looks similar to the new cdf
        method, but this also does a binned pdf (self.histo)


        '''
        if self.mcres.ndim == 2:
            if  not idx is None:
                mcres = self.mcres[:,idx]
            else:
                raise ValueError('currently only 1 statistic at a time')
        else:
            mcres = self.mcres

        if critval is None:
            histo = np.histogram(mcres, bins=10)
        else:
            if not critval[0] == -np.inf:
                bins=np.r_[-np.inf, critval, np.inf]
            if not critval[0] == -np.inf:
                bins=np.r_[bins, np.inf]
            histo = np.histogram(mcres,
                                 bins=np.r_[-np.inf, critval, np.inf])

        self.histo = histo
        self.cumhisto = np.cumsum(histo[0])*1./self.nrepl
        self.cumhistoreversed = np.cumsum(histo[0][::-1])[::-1]*self.nrepl/1.
        return histo, self.cumhisto, self.cumhistoreversed

    #use cache decorator instead
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/tools/mctools.py/StatTestMC.histogram/swapped operands of `/`