2.16 Dictionary-like get()
method
Each of Series, DataFrame, and Panel have a get
method which can return a
default value.
In [1]: s = pd.Series([1,2,3], index=['a','b','c'])
In [2]: s
Out[2]:
a 1
b 2
c 3
dtype: int64
In [3]: s.get('a') # equivalent to s['a']
Out[3]: 1
In [4]: s.get('x', default=-1)
Out[4]: -1