February 2019
Intermediate to advanced
672 pages
16h 50m
English
Retrieving data from a pd.Series, given its key, can be done intuitively by indexing the pd.Series.loc attribute:
effective_series.loc["a"] # Result: # True
It is also possible to access the elements, given its position in the underlying array, using the pd.Series.iloc attribute:
effective_series.iloc[0] # Result: # True
You can also use the pd.Series.ix attribute for mixed access. If the key is not an integer, it will try to match by key, otherwise it will extract the element at the position indicated by the integer. A similar behavior will take place when you access the pd.Series directly. The following example demonstrates these concepts:
effective_series.ix["a"] # By key effective_series.ix[0] ...