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
Closed

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

smcinerney opened this issue Apr 29, 2013 · 3 comments · Fixed by #3559
Labels
API Design Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@smcinerney
Copy link

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
Copy link
Contributor

jreback commented Apr 29, 2013

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

@cpcloud
Copy link
Member

cpcloud commented May 10, 2013

i gotchu. also allows tuples of things.

@ghost
Copy link

ghost commented May 10, 2013

merged PR.

@ghost ghost closed this as completed 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
Labels
API Design Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants