'Return a summary of descriptive statistics.
Parameters
stats: list or str
The desired statistics, Accepts \'basic\' or \'all\' or a list.
\'basic\' = (\'obs\', \'mean\', \'std\', \'min\', \'max\')
\'all\' = (\'obs\', \'mean\', \'std\', \'min\', \'max\', \'ptp\', \'var\',
\'mode\', \'meadian\', \'skew\', \'uss\', \'kurtosis\',
\'percentiles\')
columns : list or str
The columns/variables to report the statistics, default is \'all\'
If an object with named columns is given, you may specify the
column names. For example'

def summary(self, stats='basic', columns='all', orientation='auto'):

    if (self._arraytype == None):
        self._array_typer()
    if (stats == 'basic'):
        stats = ('obs', 'mean', 'std', 'min', 'max')
    elif (stats == 'all'):
        stats = ['obs', 'mean', 'std', 'min', 'max', 'ptp', 'var', 'mode_val', 'mode_bin', 'median', 'uss', 'skew', 'kurtosis', 'percentiles']
    else:
        for astat in stats:
            pass
    import scipy.stats
    def _fun(per):
        return (lambda x: scipy.stats.scoreatpercentile(x, per))
    perdict = dict(((('perc_%02d' % per), [_fun(per), None, None]) for per in (1, 5, 10, 25, 50, 75, 90, 95, 99)))
    if ('percentiles' in stats):
        self.univariate.update(perdict)
        idx = stats.index('percentiles')
        stats[idx:(idx + 1)] = sorted(iterkeys(perdict))
    if any([aitem[1] for aitem in iteritems(self.univariate) if (aitem[0] in stats)]):
        if (columns == 'all'):
            self._columns_list = []
            if (self._arraytype == 'sctruct'):
                self._columns_list = self.dataset.dtype.names
            else:
                self._columns_list = lrange(self.dataset.shape[1])
        else:
            self._columns_list = columns
            if (self._arraytype == 'sctruct'):
                for col in self._columns_list:
                    assert (col in self.dataset.dtype.names)
            else:
                assert (self._is_dtype_like(self.dataset) == 'number')
        columstypes = self.dataset.dtype
        for astat in stats:
            calc = self.univariate[astat]
            if (self._arraytype == 'sctruct'):
                calc[1] = self._columns_list
                calc[2] = [calc[0](self.dataset[col]) for col in self._columns_list if (self._is_dtype_like(col) == 'number')]
            else:
                calc[1] = [('Col    ' + str(col)) for col in self._columns_list]
                calc[2] = [calc[0](self.dataset[:, col]) for col in self._columns_list]
        return self.print_summary(stats, orientation=orientation)
    else:
        return self.print_summary(stats, orientation=orientation)
