-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: pd.concat raises if called on mixture of empty and non-empty dataframes #18178
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
Comments
This check: https://github.com/pandas-dev/pandas/blob/master/pandas/core/reshape/concat.py#L293 is a little bogus, instead if this were want to give this a shot? |
While trying to fix this, I stumbled upon #18187. There is also unexpected behavior if an empty and non-empty series are concatenated, which does not fail, but simply returns an empty series. |
@jreback the straight forward fix via Edit: I'm not so sure if "Effort Low" is the correct tag here :-D. |
sure it is, its not 0 effort, rather a an hour or 2 |
…of empty RangeIndex The `_concat_rangeindex_same_dtype` now keeps track of the last non-empty RangeIndex to extract the new stop value. This fixes two issues with concatenating non-empty and empty DataFrames and Series. Two regression tests were added as well.
… of empty RangeIndex (pandas-dev#18191)
… of empty RangeIndex (pandas-dev#18191) (cherry picked from commit 6b3641b)
I noticed a change in how pd.concat works between 0.20.3 and 0.21.0:
This example does not raise an exception in 0.20.3. In 0.21.0, it raises the following error:
Expected Output
I would expect no error, and all(res==df1) to be true
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.32-696.1.1.el6.centos.plus.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.21.0
pytest: 3.2.3
pip: 9.0.1
setuptools: 36.2.2.post20170724
Cython: 0.26
numpy: 1.13.3
scipy: 0.19.1
pyarrow: None
xarray: None
IPython: 6.1.0
sphinx: 1.6.4
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.4.0
numexpr: 2.6.2
feather: None
matplotlib: None
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: 1.0.2
lxml: None
bs4: 4.6.0
html5lib: None
sqlalchemy: 1.1.14
pymysql: 0.7.11.None
psycopg2: None
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: