def indices_for(df, nprocs):
    """
        group rows in dataframe and assign each group to each process

        Args:
        df: Pandas dataframe object
        nprocs: number of processes used

        Returns:
        indeces grouped to each process
    """
    N = df.shape[0]
    L = int(N / nprocs)
    indices = []
    for i in range(nprocs):
        for j in range(L):
            indices.append(i)
    for i in range(N - (nprocs * L)):
        indices.append(nprocs - 1)
    return indices