def rand_latin_hypercube(n, k, edges=False):
    #generate nxk array of random numbers from the list of range(n) choices
    X = zeros((n, k))
    row = range(1, n+1)
    for i in range(k):
        shuffle(row)
        X[:,i] = row

    if edges:
        return (X-1.0)/float((n-1))

    return (X-.5)/float(n)
Resample arrays or sparse matrices in a consistent way
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/doegenerators/optlh.py/rand_latin_hypercube--crossover with--dataset/ETHPy150Open trevorstephens/gplearn/gplearn/skutils/__init__.py/resample