Hi everyone Thank you all for your quick replies!
I've given Marek and David's suggestions a try and both seem to work (David I had to edit yours to be $shuffled = $data -> index(qsorti(random($data))), was that what you meant? It gave a compilation error otherwise). Both are very quick and do exactly what I wanted, thank you both - David's appears to be a bit quicker so I expect I'll use that. Thanks for all the other suggestions as well, there's some things there I'll investigate once I set this running. Cheers, Nick On 6 August 2015 at 18:14, vividsnow <[email protected]> wrote: > hi > > use PDL::GSL::RNG; > $p = sequence(100); > $r = PDL::GSL::RNG->new('taus'); > $r->ran_shuffle($p); > p $p; > > On 08/06/2015 07:59 PM, Nick Wright wrote: > > Hi everyone > > > > I need help with something that I think *should* be simple with Perl/PDL > but I can't find the command for it. > > > > I basically just want to randomly re-order a 1-dimensional, moderately > long (1500 entries) piddle and I can't find a simple way. I need to do this > for the purposes of a Monte Carlo simulation, so I was hoping PDL might > have an efficient way to do it so I can repeat is 1000s of times quickly! > > > > Thanks in advance for the help! > > > > Cheers, > > > > Nick > > > > > > > ------------------------------------------------------------------------------ > > > > > > > > _______________________________________________ > > pdl-general mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/pdl-general > > > > > ------------------------------------------------------------------------------ > _______________________________________________ > pdl-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pdl-general >
------------------------------------------------------------------------------
_______________________________________________ pdl-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pdl-general
