randomise_by_index.py


# ----------------------------------------------------------------------------------------------

def randomise_by_index(inputlist,idx_list):

    """
       Function to randomize an array of data
    """
    
    if len(inputlist)!=len(idx_list):
        print("These aren't the same length")

    outputlist = []
    for i in idx_list:
        outputlist.append(inputlist[i])

    return outputlist

# ----------------------------------------------------------------------------------------------