Undocumented behavior change (1.0.5->1.1.0) when using arithmetic operations on dataframes #36702
Closed
2 of 3 tasks
Labels
Error Reporting
Incorrect or improved errors from pandas
Numeric Operations
Arithmetic, Comparison, and Logical operations
Milestone
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
pandas 1.0.5:
pandas 1.1.0:
Problem description
When applying arithmetic operations between dataframe and list of Series prior to 1.0.5 and we get different results then starting with 1.1.0. Starting with 1.1.0 we seem to get a another level of indexing, altough the dataframes columns and index return the same values, iterating over it returns different objects.
Since now the return type of the chained iloc has changed from float/int to series, this breaks functions using the arithmetic operator like this.
Expected Output
Output of
pd.show_versions()
using the latest pandas version:
pandas : 1.1.2
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.3
setuptools : 49.6.0.post20200917
Cython : None
pytest : 6.0.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.18.1
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
using 1.0.3
The text was updated successfully, but these errors were encountered: