Creation using NumPy functions

It is a common practice to initialize the Series object's various NumPy functions. As an example, the following uses the NumPy np.arange function to create a sequence of integer values between 4 and 8:

The np.linspace() method is similar in functionality but allows us to specify the number of values to be created between (and including) the two specified values, and with a specified number of steps:

It is also common to generate a set of random numbers using np.random.normal(). The following generates five random ...

Get Learning pandas - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.