Creating series
We can create series from array-like objects; these include lists, tuples, and NumPy ndarray objects. We can also create a series from a Python dict. Another way to add an index to a series is to create one by passing either an index or an array-like object of unique hashable values to the index argument of the create method for the series.
We can also create an index separately. Creating an index is a lot like creating a series, but we require all values to be unique. Every series has an index; if we do not assign an index, then a simple numeric sequence starting from 0 will be used as the index. We can give a series a name by passing a string to the name argument of the series' create method. We do this so that, if we were ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access