类似于字典的get()方法

Each of Series, DataFrame, and Panel have a get method which can return a default value.

  1. In [284]: s = pd.Series([1,2,3], index=['a','b','c'])
  2. In [285]: s.get('a') # equivalent to s['a']
  3. Out[285]: 1
  4. In [286]: s.get('x', default=-1)
  5. Out[286]: -1