pydata/pandas — pull request #3184 by waitingkuo (2013-03-27 07:32:36+00:00)
Title: BUG: Append the empty frame with columns, #3121

### Bug

In [1]: import pandas as pd

In [2]: df1 = pd.DataFrame(columns=['test'])

In [3]: df2 = pd.DataFrame()

In [4]: df1.append(df2)

ValueError: need at least one array to concatenate

### Reason

numpy cannot concatenate nothing:

In [10]: import numpy as np

In [11]: np.concatenate([])

ValueError: need at least one array to concatenate

### Fix

Return an empty numpy array if we find that the arrays to be concatenated are empty

# return the empty np array, if nothing to concatenate, #3121
if not to_concat: return np.array([], dtype=object)

### Test

Test case `test_append_empty_frame` is added in `test_frame.py`