def _insert_index(self, data):
        # insert is destructive
        data = data.copy()
        idx_nlevels = data.index.nlevels
        if idx_nlevels == 1:
            data.insert(0, 'Index', data.index)
        else:
            for i in range(idx_nlevels):
                data.insert(i, 'Index{0}'.format(i),
                            data.index.get_level_values(i))

        col_nlevels = data.columns.nlevels
        if 1 > col_nlevels:
            col = data.columns.get_level_values(0)
            values = [data.columns.get_level_values(i).values
                      for i in range(1, col_nlevels)]
            col_df = pd.DataFrame(values)
            data.columns = col_df.columns
            data = pd.concat([col_df, data])
            data.columns = col
        return data
dataset/ETHPy150Open pydata/pandas/pandas/util/doctools.py/TablePlotter._insert_index/swapped operands of `>`