Skip to content

Commit

Permalink
ENH: more helpful error message in DataFrame constructor, GH #497
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Dec 18, 2011
1 parent dcbb0cc commit 19cb89e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3554,7 +3554,9 @@ def _list_to_sdict(data, columns):
if columns is None:
columns = range(len(content))
else:
assert(len(columns) == len(content))
if len(columns) != len(content):
raise AssertionError('%d columns passed, passed data had %s '
'columns' % (len(columns), len(content)))

sdict = dict((c, lib.maybe_convert_objects(vals))
for c, vals in zip(columns, content))
Expand Down

0 comments on commit 19cb89e

Please sign in to comment.