# Buggy code
def __getitem__(self, key):
    row_loc, col_loc, ndim, self.row_scaler, self.col_scaler = _parse_tuple(key)
    self._handle_enlargement(row_loc, col_loc)
    row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)
    ndim = self._expand_dim(row_lookup, col_lookup, ndim)
    result = super(_LocIndexer, self).__getitem__(row_lookup, col_lookup, ndim)
    return result


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-f7a945237ab9> in <module>()
3     header=[0,1,2,3], index_col=0)
4 DF2.loc[1]
----> 5 DF2.loc[1, 'Presidents']

~/anaconda3/lib/python3.7/site-packages/modin/pandas/indexing.py in __getitem__(self, key)
232         row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)
233         ndim = self._expand_dim(row_lookup, col_lookup, ndim)
--> 234         result = super(_LocIndexer, self).__getitem__(row_lookup, col_lookup, ndim)
235         return result
236

~/anaconda3/lib/python3.7/site-packages/modin/pandas/indexing.py in __getitem__(self, row_lookup, col_lookup, ndim)
163             single_axis = 1 if self.col_scaler else 0
164             return SeriesView(
--> 165                 qc_view.squeeze(ndim=1, axis=single_axis),
166                 self.df,
167                 (row_lookup, col_lookup),

~/anaconda3/lib/python3.7/site-packages/modin/data_management/query_compiler/pandas_query_compiler.py in squeeze(self, ndim, axis)
2781             if axis is None:
2782                 axis = 0 if self.data.shape[1] > 1 else 1
-> 2783             squeezed = pandas.Series(to_squeeze.squeeze(axis))
2784             scaler_axis = self.columns if axis else self.index
2785             non_scaler_axis = self.index if axis else self.columns

~/anaconda3/lib/python3.7/site-packages/pandas/core/series.py in __init__(self, data, index, dtype, name, copy, fastpath)
260             else:
261                 data = sanitize_array(data, index, dtype, copy,
--> 262                                       raise_cast_failure=True)
263
264                 data = SingleBlockManager(data, index, fastpath=True)

~/anaconda3/lib/python3.7/site-packages/pandas/core/internals/construction.py in sanitize_array(data, index, dtype, copy, raise_cast_failure)
658             raise Exception('Data must be 1-dimensional')
659         else:
--> 660             subarr = com.asarray_tuplesafe(data, dtype=dtype)
661
662     # This is to prevent mixed-type Series getting all casted to

~/anaconda3/lib/python3.7/site-packages/pandas/core/common.py in asarray_tuplesafe(values, dtype)
238         # Avoid building an array of arrays:
239         # TODO: verify whether any path hits this except #18819 (invalid)
--> 240         values = [tuple(x) for x in values]
241         result = construct_1d_object_array_from_listlike(values)
242

~/anaconda3/lib/python3.7/site-packages/pandas/core/common.py in <listcomp>(.0)
238         # Avoid building an array of arrays:
239         # TODO: verify whether any path hits this except #18819 (invalid)
--> 240         values = [tuple(x) for x in values]
241         result = construct_1d_object_array_from_listlike(values)
242

TypeError: 'int' object is not iterable

# Fixed code
def __getitem__(self, key):
    row_loc, col_loc, ndim, self.row_scaler, self.col_scaler = _parse_tuple(key)
    self._handle_enlargement(row_loc, col_loc)
    row_lookup, col_lookup = self._compute_lookup(row_loc, col_loc)
    ndim = (0 if len(row_lookup) == 1 else 1) + (0 if len(col_lookup) == 1 else 1)
    result = super(_LocIndexer, self).__getitem__(row_lookup, col_lookup, ndim)
    # Pandas drops the levels that are in the `loc`, so we have to as well.
    if hasattr(result, "index") and isinstance(result.index, pandas.MultiIndex):
        if (
            isinstance(result, pandas.Series)
            and not isinstance(col_loc, slice)
            and all(col_loc[i] in result.index.levels[i] for i in range(len(col_loc)))
        ):
            result.index = result.index.droplevel(list(range(len(col_loc))))
        elif all(row_loc[i] in result.index.levels[i] for i in range(len(row_loc))):
            result.index = result.index.droplevel(list(range(len(row_loc))))
    if (
        hasattr(result, "columns")
        and isinstance(result.columns, pandas.MultiIndex)
        and all(col_loc[i] in result.columns.levels[i] for i in range(len(col_loc)))
    ):
        result.columns = result.columns.droplevel(list(range(len(col_loc))))
    return result