Andrew Wittenberg a écrit :
Hi Patrick,To shuffle a time series, simply sample your vector with indices that sorta random array: let a_shuffle = samplel(a,sortl(randu(a))) An example with multiple shuffles: let a = tsequence({100,500,600,20,90,4}) let seeds = {101,102,103} let a_shuffle = samplel(a,sortl(randu(tcat(seed,a[l=2:`a,r=lsize`]))))rep/name=s/range=1:`seeds,r=isize` (let seed = seeds[i=`s`]; list a_shuffle)
Nice Andrew. Thanks very much on this one. Patrick