'descriptive statistics by groups
Parameters
x : array, 2d
first column data, second column group labels
useranks : boolean
if true, then use ranks as data corresponding to the
scipy.stats.rankdata definition (start at 1, ties get mean)
uni, intlab : arrays (optional)
to avoid call to unique, these can be given as inputs'

def __init__(self, x, useranks=False, uni=None, intlab=None):

    self.x = np.asarray(x)
    if (intlab is None):
        (uni, intlab) = np.unique(x[:, 1], return_inverse=True)
    elif (uni is None):
        uni = np.unique(x[:, 1])
    self.useranks = useranks
    self.uni = uni
    self.intlab = intlab
    self.groupnobs = groupnobs = np.bincount(intlab)
    self.runbasic(useranks=useranks)
