examples/pandas/series_with_names.py
import pandas

planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Ceres', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', 'Pluto', 'Charon']

distance = pandas.Series([0.4, 0.7, 1, 1.5, 2.77, 5.2, 9.5, 19.6, 30, 39, 39], index = planets)

mass = pandas.Series([0.055,  0.815, 1, 0.107, 0.00015, 318, 95, 14, 17, 0.00218, 0.000254], index = planets)

print(distance)

# Mercury     0.40
# Venus       0.70
# Earth       1.00
# Mars        1.50
# Ceres       2.77
# Jupiter     5.20
# Saturn      9.50
# Uranus     19.60
# Neptune    30.00
# Pluto      39.00
# Charon     39.00
# dtype: float64


print(distance.index)
# Index(['Mercury', 'Venus', 'Earth', 'Mars', 'Ceres', 'Jupiter', 'Saturn',
#        'Uranus', 'Neptune', 'Pluto', 'Charon'],
#       dtype='object')

print(distance[distance > 10])

# Uranus     19.6
# Neptune    30.0
# Pluto      39.0
# Charon     39.0
# dtype: float64

print('------')
print(distance/mass)
# Mercury         7.272727
# Venus           0.858896
# Earth           1.000000
# Mars           14.018692
# Ceres       18466.666667
# Jupiter         0.016352
# Saturn          0.100000
# Uranus          1.400000
# Neptune         1.764706
# Pluto       17889.908257
# Charon     153543.307087
# dtype: float64