|
23 | 23 | MultiIndex, Timestamp, Timedelta)
|
24 | 24 | from pandas.formats.printing import pprint_thing
|
25 | 25 | from pandas import concat
|
26 |
| -from pandas.core.common import PerformanceWarning |
| 26 | +from pandas.core.common import PerformanceWarning, UnsortedIndexError |
27 | 27 |
|
28 | 28 | import pandas.util.testing as tm
|
29 | 29 | from pandas import date_range
|
@@ -2230,7 +2230,7 @@ def f():
|
2230 | 2230 | df = df.sortlevel(level=1, axis=0)
|
2231 | 2231 | self.assertEqual(df.index.lexsort_depth, 0)
|
2232 | 2232 | with tm.assertRaisesRegexp(
|
2233 |
| - KeyError, |
| 2233 | + UnsortedIndexError, |
2234 | 2234 | 'MultiIndex Slicing requires the index to be fully '
|
2235 | 2235 | r'lexsorted tuple len \(2\), lexsort depth \(0\)'):
|
2236 | 2236 | df.loc[(slice(None), df.loc[:, ('a', 'bar')] > 5), :]
|
@@ -2417,7 +2417,7 @@ def test_per_axis_per_level_doc_examples(self):
|
2417 | 2417 | def f():
|
2418 | 2418 | df.loc['A1', (slice(None), 'foo')]
|
2419 | 2419 |
|
2420 |
| - self.assertRaises(KeyError, f) |
| 2420 | + self.assertRaises(UnsortedIndexError, f) |
2421 | 2421 | df = df.sortlevel(axis=1)
|
2422 | 2422 |
|
2423 | 2423 | # slicing
|
@@ -3480,8 +3480,12 @@ def test_iloc_mask(self):
|
3480 | 3480 | ('index', '.loc'): '0b11',
|
3481 | 3481 | ('index', '.iloc'): ('iLocation based boolean indexing '
|
3482 | 3482 | 'cannot use an indexable as a mask'),
|
3483 |
| - ('locs', ''): 'Unalignable boolean Series key provided', |
3484 |
| - ('locs', '.loc'): 'Unalignable boolean Series key provided', |
| 3483 | + ('locs', ''): 'Unalignable boolean Series provided as indexer ' |
| 3484 | + '(index of the boolean Series and of the indexed ' |
| 3485 | + 'object do not match', |
| 3486 | + ('locs', '.loc'): 'Unalignable boolean Series provided as indexer ' |
| 3487 | + '(index of the boolean Series and of the indexed ' |
| 3488 | + 'object do not match', |
3485 | 3489 | ('locs', '.iloc'): ('iLocation based boolean indexing on an '
|
3486 | 3490 | 'integer type is not available'),
|
3487 | 3491 | }
|
|
0 commit comments