def split_list(l, N):
    step = int(len(l) / N)
    div_points = range(0, len(l) + 1, step)
    return [l[div_points[i]:div_points[i + 1]] for i in range(N)]
Split list l into N sublists of equal size
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/analysis/linesh.py/split_list