Skip to content

MAC OS: sum over empy series with object dtype gives False #25835

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

Closed
mlangiu opened this issue Mar 22, 2019 · 3 comments
Closed

MAC OS: sum over empy series with object dtype gives False #25835

mlangiu opened this issue Mar 22, 2019 · 3 comments
Labels
Duplicate Report Duplicate issue or pull request

Comments

@mlangiu
Copy link

mlangiu commented Mar 22, 2019

Code Sample, a copy-pastable example if possible

import pandas
pandas.Series(dtype='O').sum()

Problem description

Performing the above code segment with pandas 0.24.2 gives me

  • (numpy.bool_) False on a Mac with homebrew python 3.6.4
  • (int) 0 on a Windows 10 with Anaconda python 3.6.7

While I would prefer 0 for my own purposes, I suppose it is not easy to decide on an expected output here. But I would argue that it should at least be consistent.

Output of pd.show_versions()

  • MAC
INSTALLED VERSIONS ------------------

commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.24.2
pytest: 3.6.2
pip: 19.0.3
setuptools: 39.0.1
Cython: None
numpy: 1.14.2
scipy: 1.0.1
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: None
patsy: None
dateutil: 2.7.2
pytz: 2018.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.0
openpyxl: None
xlrd: 1.1.0
xlwt: None
xlsxwriter: None
lxml.etree: 4.2.5
bs4: 4.6.3
html5lib: 0.9999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
23846nemo/linearization.py000418:1
LinterAtom Ide DiagnosticsActivate Power Mode
Python 3 | idle
CRLFUTF-8PythonGitHubGit (0)4 updates

  • WIN
INSTALLED VERSIONS ------------------

commit: None
python: 3.6.7.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.24.2
pytest: 4.0.2
pip: 18.1
setuptools: 40.6.3
Cython: 0.29.2
numpy: 1.15.4
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.2.0
sphinx: 1.8.2
patsy: 0.5.1
dateutil: 2.7.5
pytz: 2018.7
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.8
feather: None
matplotlib: 3.0.2
openpyxl: 2.5.12
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.2
lxml.etree: 4.2.5
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: 1.2.15
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
47327experiments\pyomo_nl.py50:1
Python 3 | idle
CRLFenUS,deDEUTF-8Python
developmentFetchGitHubGit (45)

@WillAyd
Copy link
Member

WillAyd commented Mar 22, 2019

Strange but this returned 0 for me on a Mac:

INSTALLED VERSIONS

commit: f2bcb9f
python: 3.7.2.final.0
python-bits: 64
OS: Darwin
OS-release: 18.2.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.25.0.dev0+301.gf2bcb9f00
pytest: 4.3.0
pip: 19.0.3
setuptools: 40.8.0
Cython: 0.29.5
numpy: 1.15.4
scipy: 1.2.1
pyarrow: 0.11.1
xarray: 0.11.3
IPython: 7.3.0
sphinx: 1.8.4
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: 2.6.0
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.5
lxml.etree: 4.3.1
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: 1.2.18
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: 0.2.0
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None

Can you try on master?

@WillAyd WillAyd added the Needs Info Clarification about behavior needed to assess issue label Mar 22, 2019
@jschendel
Copy link
Member

This is a dupe of #19813. Looks like this is because you have different versions of numpy on both systems, and this behavior was fixed upstream in numpy 1.15.

@jschendel jschendel added Duplicate Report Duplicate issue or pull request and removed Needs Info Clarification about behavior needed to assess issue labels Mar 22, 2019
@jschendel jschendel added this to the No action milestone Mar 22, 2019
@mlangiu
Copy link
Author

mlangiu commented Mar 25, 2019

Sorry, my bad should have seen this; thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants