Skip to content

Commit e9a5e01

Browse files
committed
Merge pull request #3972 from cpcloud/fix-error-msg
CLN: fix grammar in extract_index error message
2 parents 8be501f + 85ac59f commit e9a5e01

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pandas/core/frame.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5713,7 +5713,8 @@ def extract_index(data):
57135713
raw_lengths.append(len(v))
57145714

57155715
if not indexes and not raw_lengths:
5716-
raise ValueError('If use all scalar values, must pass index')
5716+
raise ValueError('If using all scalar values, you must must pass'
5717+
' an index')
57175718

57185719
if have_series or have_dicts:
57195720
index = _union_indexes(indexes)

pandas/tests/test_frame.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2245,8 +2245,9 @@ def test_constructor_error_msgs(self):
22452245
try:
22462246
DataFrame({'a': False, 'b': True})
22472247
except (Exception), detail:
2248+
msg = 'If using all scalar values, you must must pass an index'
22482249
self.assert_(type(detail) == ValueError)
2249-
self.assert_("If use all scalar values, must pass index" in str(detail))
2250+
self.assert_(msg in str(detail))
22502251

22512252
def test_constructor_subclass_dict(self):
22522253
# Test for passing dict subclass to constructor

0 commit comments

Comments
 (0)