Skip to main content
shorten code
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

You may Flatten the list and then take a RandomSample before partitioning to the original dimensions with Length and TakeList.

With keys the list in the OP then

TakeList[RandomSample[Flatten@keys,TakeList[RandomSample All]@ Flatten @ keys, Length /@ keys]

Hope this helps.

You may Flatten the list and then take a RandomSample before partitioning to the original dimensions with Length and TakeList.

With keys the list in the OP then

TakeList[RandomSample[Flatten@keys, All], Length /@ keys]

Hope this helps.

You may Flatten the list and then take a RandomSample before partitioning to the original dimensions with Length and TakeList.

With keys the list in the OP then

TakeList[RandomSample @ Flatten @ keys, Length /@ keys]

Hope this helps.

Source Link
Edmund
  • 43.2k
  • 3
  • 53
  • 148

You may Flatten the list and then take a RandomSample before partitioning to the original dimensions with Length and TakeList.

With keys the list in the OP then

TakeList[RandomSample[Flatten@keys, All], Length /@ keys]

Hope this helps.