def getRandomSample(data, minimum=-1, maximum=361):
    """ Return a random sample within a data set.

    data is a DataFrame object from the pandas module.
    minimum and maximum arguments are optional angles (degree) limits in which
    the random sample needs to be, by default there is no limits.
    """

    # Get a random sample
    sample = data.sample(n=1).iloc[0]  # take a random sample

    # Take another one if it is not in the limits
    while sample.angle < minimum or sample.angle > maximum:
        sample = data.sample(n=1).iloc[0]

    return sample