xysample

imagepypelines.xysample(data, labels, sample_fraction=0.05)[source]

function to randomly sample list data and corresponding labels using a uniform distribution

Example

>>> import random
>>> random.seed(0)
>>> import imagepypelines as ip
>>> data = [0,1,2,3,4,5,6,7,8,9]
>>> labels = ['0','1','2','3','4','5','6','7','8','9']
>>>
>>> small_data, small_labels = ip.xysample(data,labels,.2)