Skip to content
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

Raise more helpful exception when concat() wrongly called as concat(obj1,obj2) #3481

Closed
smcinerney opened this issue Apr 29, 2013 · 3 comments · Fixed by #3559

Comments

@smcinerney
Copy link

commented Apr 29, 2013

concat is supposed to be called with objs = a list or dict. Not multiple objects as as separate args. RIGHT: concat([df1,df2]) WRONG: concat(df1,df2)
The exception thrown in the latter case is seriously cryptic.


df1 = pd.DataFrame(randn(5,3), columns=['a','b','c'])
df2 = pd.DataFrame(randn(5,3), columns=['a','b','c'])
pd.concat(df1,df2)
... File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/frame.py", line 587, in nonzero
raise ValueError("Cannot call bool() on DataFrame.")

ValueError: Cannot call bool() on DataFrame.

Version: 0.10.1

@jreback

This comment has been minimized.

Copy link
Contributor

commented Apr 29, 2013

yep...should fail fast, easy to raise if the objs is not a list or dict.....PR to fix?

@cpcloud

This comment has been minimized.

Copy link
Member

commented May 10, 2013

i gotchu. also allows tuples of things.

@ghost

This comment has been minimized.

Copy link

commented May 10, 2013

merged PR.

@ghost ghost closed this May 10, 2013

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.