Skip to content

CLN: fix grammar in extract_index error message #3972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5713,7 +5713,8 @@ def extract_index(data):
raw_lengths.append(len(v))

if not indexes and not raw_lengths:
raise ValueError('If use all scalar values, must pass index')
raise ValueError('If using all scalar values, you must must pass'
' an index')

if have_series or have_dicts:
index = _union_indexes(indexes)
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,9 @@ def test_constructor_error_msgs(self):
try:
DataFrame({'a': False, 'b': True})
except (Exception), detail:
msg = 'If using all scalar values, you must must pass an index'
self.assert_(type(detail) == ValueError)
self.assert_("If use all scalar values, must pass index" in str(detail))
self.assert_(msg in str(detail))

def test_constructor_subclass_dict(self):
# Test for passing dict subclass to constructor
Expand Down