Skip to content

Commit

Permalink
ENH: tweak error message for #1001
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Apr 9, 2012
1 parent 8caedef commit acfa20a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1712,9 +1712,9 @@ def lookup(self, row_labels, col_labels):
ridx = self.index.get_indexer(row_labels)
cidx = self.columns.get_indexer(col_labels)
if (ridx == -1).any():
raise ValueError("Bad row label(s)")
raise ValueError('One or more row labels was not found')
if (cidx == -1).any():
raise ValueError("Bad col label(s)")
raise ValueError('One or more column labels was not found')
flat_index = ridx * len(self.columns) + cidx
result = values.flat[flat_index]
else:
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,10 @@ def testit(df):
assert_almost_equal(df['mask'], exp_mask)
self.assert_(df['mask'].dtype == np.bool_)

self.assertRaises(ValueError, self.frame.lookup,
self.assertRaises(ValueError, self.frame.lookup,
['xyz'], ['A'])

self.assertRaises(ValueError, self.frame.lookup,
self.assertRaises(ValueError, self.frame.lookup,
[self.frame.index[0]], ['xyz'])

def test_set_value(self):
Expand Down

0 comments on commit acfa20a

Please sign in to comment.