def swapaxes(self, axis1, axis2, copy=True):
i = self._get_axis_number(axis1)<EOL>j = self._get_axis_number(axis2)<EOL>if i == j:<EOL><INDENT>if copy:<EOL><INDENT>return self.copy()<EOL><DEDENT>return self<EOL><DEDENT>mapping = {i: j, j: i}<EOL>new_axes = (self._get_axis(mapping.get(k, k))<EOL>for k in range(self._AXIS_LEN))<EOL>new_values = self.values.swapaxes(i, j)<EOL>if copy:<EOL><INDENT>new_values = new_values.copy()<EOL><DEDENT>return self._constructor(new_values, *new_axes).__finalize__(self)<EOL>
Interchange axes and swap values axes appropriately.

Returns
-------
y : same as input