I have 40.000 IDs which are the keys in a dictionary. I need to shuffle them, with random.shuffle for example. But can I skip that step?
Dictionary doesn't store the keys with the order they come, so if I do keys = dict.keys()
, then keys
contains the keys in a non-ascending order. My program is only going to run once, so I do not care if the "result of the permutation" is the same among executions.
So, can I "cheat" and skip the shuffle step?
I understand that the order of keys is a bit predictable. What I am asking though is this:
What is the chance (roughly speaking) of a permutation generated by random.shuffle()
to be (much) identical to the order of the keys?