A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/9157 below:

Clearer error message for pd.concat if empty iterator is passed · Issue #9157 · pandas-dev/pandas · GitHub

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4