-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode
Milestone
Description
I just saw following problem on stackoverflow: http://stackoverflow.com/questions/27665560/concatenating-files-with-python-pandas
It is not possible to concatenate an empty sequence of data frames.
This tiny code fragment
import pandas as pd
dfs = []
pd.concat(dfs)
Throws following error:
/Users/ch/miniconda/envs/sci33/lib/python3.3/site-packages/pandas/tools/merge.py in __init__(self, objs, axis, join, join_axes, keys, levels, names, ignore_index, verify_integrity, copy)
765
766 if len(objs) == 0:
--> 767 raise ValueError('All objects passed were None')
768
769 # consolidate data & figure out what our result ndim is going to be
ValueError: All objects passed were None
I would suggest catching this special case in pd.concat
before trying to merge and to raise an error with a clearer error description. For this special case, the current error message is not very helpful.
Metadata
Metadata
Assignees
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode