Shuffle
Shuffling is the random rearrangement of elements in a collection, sequence, or dataset.
Deep Learning with Python, Third Edition
To randomly reorder data before splitting it so that contiguous ordering does not bias the partition.
- How it is used
- Uses random reordering to make training and evaluation partitions representative when source ordering is accidental.
- How deep it goes
- Explains the operation, demonstrates Python and Dataset APIs, and covers temporal leakage and duplicate-data caveats.
- Examples
- Demonstrates ordered digit classes, COCO images grouped by object type, Python random.shuffle, and Dataset .shuffle(buffer_size).
- What you can do after
- Apply it via random.shuffle or Dataset.shuffle while avoiding temporal leakage and overlapping evaluation data.
Read how Deep Learning with Python, Third Edition explains shuffle →
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
An operation that rearranges a collection into a random order.
- How it is used
- Prepares a card deck for dealing by rearranging its cards before blackjack play.
- How deep it goes
- Explains Set-to-array conversion, random selection, swapping, clearing, and reinsertion without discussing randomness quality.
- Examples
- Uses a 52-card Set assembled from suits and faces, then shuffled before cards are dealt.
- What you can do after
- Build it from scratch by swapping array entries and restoring their order in a Set.
Clojure: The Essential Reference
shuffle is a Clojure function that returns a vector containing a random permutation of the elements in a supported collection.
- How it is used
- Distributes randomized startup choices across equivalent servers before sequential request handling.
- How deep it goes
- Defines inputs, outputs, exceptions, and Fisher–Yates implementation, without detailing the algorithm’s internal steps.
- Examples
- Demonstrates randomized host ordering for round-robin requests and contrasts whole-collection permutation with single-element selection.
- What you can do after
- Apply it via Clojure’s shuffle function to randomize supported collections and distribute sequential choices.
Read how Clojure: The Essential Reference explains shuffle →
Related concepts
- sorting algorithmcontrasts with · A sorting algorithm is a procedure that arranges elements of a collection into an order determined by a specified criterion.
- vectorproduces · A vector is an ordered, indexed sequence of elements, often numerical, represented as a mathematical quantity or a computational collection.
- pseudo-random number generatoruses · A pseudorandom number generator is a deterministic computational process that uses an initial seed or internal state to produce a sequence with random-like statistical properties.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


