Tools 1.7The video for this lesson is on its way.
Everything else is ready: study the parts, the key terms and the quiz below.
- Part 11Where this module's data came from, and why it must regenerate
- Part 22A call that returns different numbers every run
- Part 33default r n g with a seed: a generator with its own state
- Part 44random, integers, normal and choice, and the size argument
- Part 55The generator advances: the same call twice gives different values
- Part 66Sampling rows with choice, with and without replacement
- Part 77permutation: one order applied to both arrays
- Part 88One extra call shifts every value below it
- Part 99np dot random dot seed, and the legacy global stream
- Part 1010A seed makes a result repeatable, not correct
- Part 1111Regenerating this module's data from its seed
- Part 1212Recap and your challenge
Tools 1.7Code walkthrough12 parts
Random Numbers and Reproducibility
Generate random data you can reproduce.
Loading your progress…Next: 2.1 Meet pandas
In this lesson12 parts
- 01Where this module's data came from, and why it must regenerate
- 02A call that returns different numbers every run
- 03default r n g with a seed: a generator with its own state
- 04random, integers, normal and choice, and the size argument
- 05The generator advances: the same call twice gives different values
- 06Sampling rows with choice, with and without replacement
- 07permutation: one order applied to both arrays
- 08One extra call shifts every value below it
- 09np dot random dot seed, and the legacy global stream
- 10A seed makes a result repeatable, not correct
- 11Regenerating this module's data from its seed
- 12Recap and your challenge
Key terms
The words this lesson introduces, each in one line. The module’s glossary collects them all.
- Generator
- Object with its own random state and sampling methods
- Seed
- Starting value used to reproduce a generator's sequence
- Permutation
- Reordering of positions without duplication
Quiz 5 questions
Your first pick on each question is the one that counts, and a right one earns a coin. Getting one wrong here is how the lesson sticks.
Practice
Problems to solve in your own notebook. Each states the problem, not the steps: working out the steps is the exercise. Level A applies the lesson, B combines it with earlier ones, C stretches it.
The self-checking notebook for this lesson is Random numbers and reproducibility.
Where it’s used
Where this lesson’s ideas turn up in real work.