- Learning pandas(Second Edition)
- Michael Heydt
- 66字
- 2025-02-22 14:06:23
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?:
