O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specifying an index at creation

The labels in an index can be specified at the creation of the Series by using the index parameter of the constructor. The following creates a Series and assigns strings to each label of the index:

Examining the .index property, we find the following index was created:

Using this index, we can ask a question such as who is the Dad?:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required