-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: max
and min
returns incorrect result
#39607
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
are you sure? the prior was coerced to float |
To me, 1.2.1 behavior looks more correct. I just wanted to make sure of this. If you think so too, the issue should be closed. |
i think this is the result of the change to operate block-wise instead of on |
The 1.2 result preserves more information about the actual dtype of the original columns, but on the other hand it also results in a less-useful object dtype Series (and this object dtype can then propagate in following operations). See also #39817, as this is also related to the question how to combine bool + numeric dtypes. |
This is correct as-is, closing. |
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.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
The same relates to
min
.Expected Output
Output of
pd.show_versions()
pandas : 1.2.1
numpy : 1.19.5
pytz : 2020.5
dateutil : 2.8.1
pip : 20.3.3
setuptools : 52.0.0.post20210125
Cython : None
pytest : 6.2.1
hypothesis : None
sphinx : 3.4.3
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.6.2
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.19.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : None
fsspec : 0.8.3
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.2
odfpy : None
openpyxl : 3.0.6
pandas_gbq : None
pyarrow : 2.0.0
pyxlsb : None
s3fs : 0.5.2
scipy : 1.6.0
sqlalchemy : 1.3.22
tables : 3.6.1
tabulate : None
xarray : 0.16.2
xlrd : 2.0.1
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: