def xs(self, key, axis=<NUM_LIT:1>):
axis = self._get_axis_number(axis)<EOL>if axis == <NUM_LIT:0>:<EOL><INDENT>return self[key]<EOL><DEDENT>self._consolidate_inplace()<EOL>axis_number = self._get_axis_number(axis)<EOL>new_data = self._data.xs(key, axis=axis_number, copy=False)<EOL>result = self._construct_return_type(new_data)<EOL>copy = new_data.is_mixed_type<EOL>result._set_is_copy(self, copy=copy)<EOL>return result<EOL>
Return slice of panel along selected axis.

Parameters
----------
key : object
    Label
axis : {'items', 'major', 'minor}, default 1/'major'

Returns
-------
y : ndim(self)-1

Notes
-----
xs is only for getting, not setting values.

MultiIndex Slicers is a generic way to get/set values on any level or
levels and is a superset of xs functionality, see
:ref:`MultiIndex Slicers <advanced.mi_slicers>`