def tz_convert(self, tz, axis=<NUM_LIT:0>, level=None, copy=True):
axis = self._get_axis_number(axis)<EOL>ax = self._get_axis(axis)<EOL>def _tz_convert(ax, tz):<EOL><INDENT>if not hasattr(ax, '<STR_LIT>'):<EOL><INDENT>if len(ax) > <NUM_LIT:0>:<EOL><INDENT>ax_name = self._get_axis_name(axis)<EOL>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>' % ax_name)<EOL><DEDENT>else:<EOL><INDENT>ax = DatetimeIndex([], tz=tz)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ax = ax.tz_convert(tz)<EOL><DEDENT>return ax<EOL><DEDENT>if isinstance(ax, MultiIndex):<EOL><INDENT>level = ax._get_level_number(level)<EOL>new_level = _tz_convert(ax.levels[level], tz)<EOL>ax = ax.set_levels(new_level, level=level)<EOL><DEDENT>else:<EOL><INDENT>if level not in (None, <NUM_LIT:0>, ax.name):<EOL><INDENT>raise ValueError("<STR_LIT>".format(level))<EOL><DEDENT>ax = _tz_convert(ax, tz)<EOL><DEDENT>result = self._constructor(self._data, copy=copy)<EOL>result = result.set_axis(ax, axis=axis, inplace=False)<EOL>return result.__finalize__(self)<EOL>
Convert tz-aware axis to target time zone.

Parameters
----------
tz : string or pytz.timezone object
axis : the axis to convert
level : int, str, default None
    If axis ia a MultiIndex, convert a specific level. Otherwise
    must be None
copy : boolean, default True
    Also make a copy of the underlying data

Returns
-------

Raises
------
TypeError
    If the axis is tz-naive.