Peter Otten wrote: > Maybe you could sort the already-sorted property_b again, with some random > offset: > >>>> import itertools >>>> def wiggled(items, sigma): > ... counter = itertools.count() > ... def key(item): return random.gauss(next(counter), sigma) > ... return sorted(items, key=key) > ...
One more example: >>> s = """\ ... But my actual scientific problem requires that the correlation should be ... only approximate and I do not know how close to to a perfect correlation ... it should be. So, I need to introduce some lack of good correlation when ... I set up the correlation. How to do that is my problem. ... """ >>> print(textwrap.fill(" ".join(wiggled(s.split(), 2)))) But actual my scientific the requires that problem should only correlation approximate be and not do I know how close to a perfect to correlation should it So, be. I to lack need some introduce correlation I of good when set correlation. up How to the that do problem. is my :) _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor