Skip to content

appending empty dataframe with columns fails #3121

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

Closed
michael-hy opened this issue Mar 21, 2013 · 2 comments
Closed

appending empty dataframe with columns fails #3121

michael-hy opened this issue Mar 21, 2013 · 2 comments
Labels
Milestone

Comments

@michael-hy
Copy link

I am trying to append an empty dataframe to another empty one. This fails if at least one of them has a column defined. Below is the code snippet to generate the error.

import numpy as np
import pandas as pd
pd.__version__
#'0.10.1'
np.__version__
#'1.7.0'

a = pd.DataFrame()
b = pd.DataFrame()
a.append(b) # works

a = pd.DataFrame(columns=['asdf'])
b = pd.DataFrame(columns=['asdf'])
a.append(b) # fails

a = pd.DataFrame(columns=['asdf'])
b = pd.DataFrame()
a.append(b) # fails

a = pd.DataFrame()
b = pd.DataFrame(columns=['asdf'])
a.append(b) # fails

Exception is: ValueError: need at least one array to concatenate

waitingkuo added a commit to waitingkuo/pandas that referenced this issue Mar 27, 2013
@waitingkuo
Copy link
Contributor

Please ignore the first two commit, I've delete that branch but don't know how to delete the comments

hayd added a commit that referenced this issue Apr 3, 2013
BUG: Append the empty frame with columns, #3121
@guyrt
Copy link
Contributor

guyrt commented Aug 6, 2013

This has been fixed. Could Someone close it?

@hayd hayd closed this as completed Aug 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants