mercredi 28 février 2018

How to oversample an array of n string elements into an array of m string elements

l would like to oversample an array of n element into an array of m elements such that m > n.

For instance let's take n=3

colors=['red','blue','green']

set m =7

What l'm looking for ?

 oversampled_colors=['green','blue','red','red','blue','green','blue']




Aucun commentaire:

Enregistrer un commentaire