First page Back Continue Last page Overview Graphics

Accessing Values of a Series

It's possible to access single values of a Series:

>>> fruits = ['peaches', 'oranges', 'cherries', 'pears']

>>> S = pd.Series([20, 33, 52, 10], index=fruits)

>>> S['peaches']

20

We can also access more than one value by using a list of indices:

>>> S[['peaches', 'cherries', 'oranges']]

peaches 20

cherries 52

oranges 33

dtype: int64