def get(self, key: Any, default: Optional[Any]=None) -> Any:
    "\n        Get item from object for given key (DataFrame column, Panel slice,\n        etc.). Returns default value if not found.\n\n        Parameters\n        ----------\n        key : object\n\n        Returns\n        -------\n        value : same type as items contained in object\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'x':range(3), 'y':['a','b','b'], 'z':['a','b','b']},\n        ...                   columns=['x', 'y', 'z'], index=[10, 20, 20])\n        >>> df\n            x  y  z\n        10  0  a  a\n        20  1  b  b\n        20  2  b  b\n\n        >>> df.get('x')\n        10    0\n        20    1\n        20    2\n        Name: x, dtype: int64\n\n        >>> df.get(['x', 'y'])\n            x  y\n        10  0  a\n        20  1  b\n        20  2  b\n\n        >>> df.x.get(10)\n        0\n\n        >>> df.x.get(20)\n        20    1\n        20    2\n        Name: x, dtype: int64\n\n        >>> df.x.get(15, -1)\n        -1\n        "
    try:
        return self[key]
    except (KeyError, ValueError, IndexError):
        return default
Get item from object for given key (DataFrame column, Panel slice,
etc.). Returns default value if not found.

Parameters
----------
key : object

Returns
-------
value : same type as items contained in object

Examples
--------
>>> df = ps.DataFrame({'x':range(3), 'y':['a','b','b'], 'z':['a','b','b']},
...                   columns=['x', 'y', 'z'], index=[10, 20, 20])
>>> df
    x  y  z
10  0  a  a
20  1  b  b
20  2  b  b

>>> df.get('x')
10    0
20    1
20    2
Name: x, dtype: int64

>>> df.get(['x', 'y'])
    x  y
10  0  a
20  1  b
20  2  b

>>> df.x.get(10)
0

>>> df.x.get(20)
20    1
20    2
Name: x, dtype: int64

>>> df.x.get(15, -1)
-1
def get(self, key: Any, default: Optional[Any]=None) -> Any:
    "\n        Get item from object for given key (DataFrame column, Panel slice,\n        etc.). Returns default value if not found.\n\n        Parameters\n        ----------\n        key : object\n\n        Returns\n        -------\n        value : same type as items contained in object\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'x':range(3), 'y':['a','b','b'], 'z':['a','b','b']},\n        ...                   columns=['x', 'y', 'z'], index=[10, 20, 20])\n        >>> df\n            x  y  z\n        10  0  a  a\n        20  1  b  b\n        20  2  b  b\n\n        >>> df.get('x')\n        10    0\n        20    1\n        20    2\n        Name: x, dtype: int64\n\n        >>> df.get(['x', 'y'])\n            x  y\n        10  0  a\n        20  1  b\n        20  2  b\n\n        >>> df.x.get(10)\n        0\n\n        >>> df.x.get(20)\n        20    1\n        20    2\n        Name: x, dtype: int64\n\n        >>> df.x.get(15, -1)\n        -1\n        "
    try:
        return self[key]
    except (KeyError, ValueError, IndexError):
        return default