liveBook · Manning

Integers

As explained in Pandas Workout: 200 exercises to make you a stronger data analyst

integers is a NumPy random-generator method that returns an array of pseudorandom integers in a specified range and size.

integers is a NumPy random-generator method for producing an array of pseudorandom integers. Call it on a generator created with np.random.default_rng, supplying a minimum, an exclusive upper bound, and the array length. section 1.3

Generate monthly values

g = np.random.default_rng(0) months = 'Sep Oct Nov Dec Jan Feb Mar Apr May Jun'.split() s = Series(g.integers(70, 101, 10), index=months)

How Pandas Workout: 200 exercises to make you a stronger data analyst covers it

How deep it goes
Explains arguments, exclusive upper bounds, arrays, and seeding, then stops short of generator internals.
Examples
Uses ten seeded monthly values ranging from 70 through 100 and places them in a month-indexed Series.
What it assumes
Assumes familiarity with NumPy and pandas Series while teaching generator creation and inclusive-range planning.
What you can do after
Build it from scratch by generating reproducible integer arrays and inserting them into pandas Series.
How it connects
Connects random number generators, NumPy arrays, pandas Series, indexes, and random.randint.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pandas Workout: 200 exercises to make you a stronger data analyst. The section links point to the parts of the book it draws on.