[SciPy-User] [job] Python Job at Hedge Fund

Vincent Schut schut at sarvision.nl
Thu Jun 9 04:39:55 EDT 2011


<snip>
>> Ha. I also thought about using:
>>
>>>> x = [c for c in x]
>>>> rs = np.random.RandomState([1,2,3])
>>>> rs.shuffle(x)
>>>> ''.join(x)
>> 'oauoeyphjlot.nrdmorb at oerrg'
>>
>> Would that have cut down on the number of resumes? Not from this list.
>> Give it a try.
>
> rs = np.random.RandomState([1,2,3])
> xs = 'oauoeyphjlot.nrdmorb at oerrg'
> xs = [c for c in xs]
> x = np.asarray(xs)
> i = range(len(xs))
> rs.shuffle(i)
> x[i] = xs
> print ''.join(x)
>
> sorry it took so long, cooking lasagna in the meantime... :-)
>
> VS.

or, slightly more elegant:

rs = np.random.RandomState([1,2,3])
xs = 'oauoeyphjlot.nrdmorb at oerrg'
xs = [c for c in xs]
xs = np.asarray(xs)
i = np.arange(len(xs))
rs.shuffle(i)
print ''.join(xs[np.argsort(i)])




More information about the SciPy-User mailing list