dimanche 23 avril 2017

append items from shuffled list to a new list

I have 3 lists with filenames. I want to shuffle these lists and then append 5000 filenames from each shuffled list to a new list. Beneath you can see what I wrote so far. But I know that random.shuffle returns none and a none type object is not iterable. How can I solve this problem?

def seed():
   return 0.47231099848

teens = [list of files]
tweens = [list of files]
thirthies = list of files
data = []
for categorie in random.shuffle([teens, tweens, thirthies],seed):
    data.append(teens[:5001])
    data.append(tweens[:5001])
    data.append(thirthies[:5001])




Aucun commentaire:

Enregistrer un commentaire