Closed
Description
Fix this Exception to be better (probably the same tuple-index
error or something...)
>>> import pandas.util.testing as tm
>>> ts = tm.makeTimeSeries()
>>> ts[:, 2] = None
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "pandas/core/series.py", line 1061, in __setitem__
self._set_with(key, value)
File "pandas/core/series.py", line 1103, in _set_with
self._set_labels(key, value)
File "pandas/core/series.py", line 1110, in _set_labels
indexer = self.index.get_indexer(key)
File "pandas/core/index.py", line 920, in get_indexer
return this.get_indexer(target, method=method, limit=limit)
File "pandas/core/index.py", line 935, in get_indexer
indexer = self._engine.get_indexer(target.values)
File "index.pyx", line 267, in pandas.index.IndexEngine.get_indexer (pandas/index.c:5079)
File "hashtable.pyx", line 722, in pandas.hashtable.PyObjectHashTable.lookup (pandas/hashtable.c:11394)
TypeError: unhashable type
Compare to this exception for getitem for the same thing:
>>> ts[:, 2]
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "pandas/core/series.py", line 944, in __getitem__
return self._get_with(key)
File "pandas/core/series.py", line 961, in _get_with
return self._get_values_tuple(key)
File "pandas/core/series.py", line 1007, in _get_values_tuple
raise ValueError('Can only tuple-index with a MultiIndex')
ValueError: Can only tuple-index with a MultiIndex