# Buggy code
def __getitem__(self, key):
    try:
        return self._get_val_at(self.index.get_loc(key))

    except KeyError:
        if isinstance(key, (int, np.integer)):
            return self._get_val_at(key)
        elif key is Ellipsis:
            return self
        raise Exception("Requested index not in this series!")

    except TypeError:
        # Could not hash item, must be array-like?
        pass

    # is there a case where this would NOT be an ndarray?
    # need to find an example, I took out the case for now

    key = _values_from_object(key)
    dataSlice = self.values[key]
    new_index = Index(self.index.view(ndarray)[key])
    return self._constructor(dataSlice, index=new_index).__finalize__(self)


# Traceback (TypeError)
Traceback (most recent call last):
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/series.py", line 420, in _get_values
fastpath=True).__finalize__(self)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/series.py", line 222, in __init__
self.index = index
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/generic.py", line 2685, in __setattr__
return object.__setattr__(self, name, value)
File "pandas/src/properties.pyx", line 65, in pandas.lib.AxisProperty.__set__ (pandas/lib.c:44748)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 274, in _set_axis
labels = _ensure_index(labels)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/indexes/base.py", line 3409, in _ensure_index
return Index(index_like)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/indexes/base.py", line 268, in __new__
cls._scalar_data_error(data)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/indexes/base.py", line 483, in _scalar_data_error
repr(data)))
TypeError: Index(...) must be called with a collection of some kind, None was passed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/base.py", line 46, in __str__
return self.__unicode__()
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/series.py", line 306, in __unicode__
series_rep = Series.__unicode__(self)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 984, in __unicode__
max_rows=max_rows)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 1025, in to_string
dtype=dtype, name=name, max_rows=max_rows)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 1052, in _get_repr
max_rows=max_rows)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/formats/format.py", line 145, in __init__
self._chk_truncate()
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/formats/format.py", line 158, in _chk_truncate
series = concat((series.iloc[:row_num],
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1296, in __getitem__
return self._getitem_axis(key, axis=0)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1587, in _getitem_axis
return self._get_slice_axis(key, axis=axis)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 1579, in _get_slice_axis
return self._slice(slice_obj, axis=axis, kind='iloc')
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/indexing.py", line 99, in _slice
return self.obj._slice(obj, axis=axis, kind=kind)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/core/series.py", line 578, in _slice
return self._get_values(slobj)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/series.py", line 422, in _get_values
return self[indexer]
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/series.py", line 396, in __getitem__
return self._get_val_at(self.index.get_loc(key))
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/series.py", line 392, in _get_val_at
return self.block.values._get_val_at(loc)
File "/Users/bryan/anaconda3/lib/python3.5/site-packages/pandas/sparse/array.py", line 308, in _get_val_at
if loc < 0:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

# Fixed code
def __getitem__(self, key):
    try:
        return self.index.get_value(self, key)

    except InvalidIndexError:
        pass
    except KeyError:
        if isinstance(key, (int, np.integer)):
            return self._get_val_at(key)
        elif key is Ellipsis:
            return self
        raise Exception("Requested index not in this series!")

    except TypeError:
        # Could not hash item, must be array-like?
        pass

    key = _values_from_object(key)
    if self.index.nlevels > 1 and isinstance(key, tuple):
        # to handle MultiIndex labels
        key = self.index.get_loc(key)
    return self._constructor(self.values[key], index=self.index[key]).__finalize__(self)