def makeCategoricalIndex(k=10, n=3, name=None):
 x = rands_array(nchars=4, size=n)
 return CategoricalIndex(np.random.choice(x, k), name=name)

def makeCategoricalIndex ( k = 10 , n = 3 , name = None ) : x = rands_array ( nchars = 4 , size = n ) return CategoricalIndex ( np . random . choice ( x , k ) , name = name )
make a length k index or n categories .