{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6251","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6251/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6251/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6251/events","html_url":"https://github.com/numpy/numpy/issues/6251","id":103329026,"number":6251,"title":"What is wrong if ``np.zeros(2) == 0`` returns ``array([False,  True], dtype=bool)``?","user":{"login":"andsor","id":1507695,"avatar_url":"https://avatars.githubusercontent.com/u/1507695?v=3","gravatar_id":"","url":"https://api.github.com/users/andsor","html_url":"https://github.com/andsor","followers_url":"https://api.github.com/users/andsor/followers","following_url":"https://api.github.com/users/andsor/following{/other_user}","gists_url":"https://api.github.com/users/andsor/gists{/gist_id}","starred_url":"https://api.github.com/users/andsor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andsor/subscriptions","organizations_url":"https://api.github.com/users/andsor/orgs","repos_url":"https://api.github.com/users/andsor/repos","events_url":"https://api.github.com/users/andsor/events{/privacy}","received_events_url":"https://api.github.com/users/andsor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-26T17:49:11Z","updated_at":"2015-08-26T18:59:37Z","closed_at":null,"body":"Hi, my first issue here in this great package so please bear with me :-)\r\nAs I encounter the above and this strange behaviour in a HPC environment.\r\n\r\n```python\r\nimport numpy as np\r\nfor i in range(42):\r\n    result = np.zeros(i) == 0.0\r\n    print(i, np.nonzero(np.invert(result))[0])\r\n```\r\nprints\r\n```\r\n0 []\r\n1 []\r\n2 [0]\r\n3 [0]\r\n4 [0]\r\n5 [0]\r\n6 [0]\r\n7 [0]\r\n8 []\r\n9 [8]\r\n10 [8]\r\n11 [8]\r\n12 [8]\r\n13 [8]\r\n14 [8]\r\n15 [8]\r\n16 []\r\n17 [16]\r\n18 [16]\r\n19 [16]\r\n20 [16]\r\n21 [16]\r\n22 [16]\r\n23 [16]\r\n24 []\r\n25 [24]\r\n26 [24]\r\n27 [24]\r\n28 [24]\r\n29 [24]\r\n30 [24]\r\n31 [24]\r\n32 []\r\n33 [32]\r\n34 [32]\r\n35 [32]\r\n36 [32]\r\n37 [32]\r\n38 [32]\r\n39 [32]\r\n40 []\r\n41 [40]\r\n```\r\n\r\n```\r\nnp.show_config()\r\n```\r\n```\r\nlapack_mkl_info:\r\n  NOT AVAILABLE\r\nopenblas_info:\r\n  NOT AVAILABLE\r\nblas_mkl_info:\r\n  NOT AVAILABLE\r\nblas_opt_info:\r\n    define_macros = [('ATLAS_INFO', '\"\\\\\"3.10.2\\\\\"\"')]\r\n    libraries = ['ptf77blas', 'ptcblas', 'atlas']\r\n    language = c\r\n    library_dirs = ['/usr/nld/atlas-3.10.2/lib']\r\natlas_threads_info:\r\n    define_macros = [('ATLAS_INFO', '\"\\\\\"3.10.2\\\\\"\"')]\r\n    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']\r\n    language = f77\r\n    library_dirs = ['/usr/nld/atlas-3.10.2/lib']\r\nlapack_opt_info:\r\n    define_macros = [('ATLAS_INFO', '\"\\\\\"3.10.2\\\\\"\"')]\r\n    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']\r\n    language = f77\r\n    library_dirs = ['/usr/nld/atlas-3.10.2/lib']\r\natlas_blas_threads_info:\r\n    define_macros = [('ATLAS_INFO', '\"\\\\\"3.10.2\\\\\"\"')]\r\n    libraries = ['ptf77blas', 'ptcblas', 'atlas']\r\n    language = c\r\n    library_dirs = ['/usr/nld/atlas-3.10.2/lib']\r\nmkl_info:\r\n  NOT AVAILABLE\r\nopenblas_lapack_info:\r\n  NOT AVAILABLE\r\n```\r\n\r\nNumPy compilation with\r\n```\r\nexport ATLAS=/usr/nld/atlas-3.10.2/lib/libtatlas.so\r\nexport LAPACK=/usr/nld/atlas-3.10.2/lib/liblapack.a\r\nexport BLAS=/usr/nld/atlas-3.10.2/lib/libcblas.a\r\n```\r\n\r\n- Python 3.4.3 CPython\r\n- GCC 4.3.4 [gcc-4_3-branch revision 152973\r\n- Linux-2.6.32.59-0.7-default-x86_64-with-SuSE-11-x86_64\r\n\r\n```\r\n$ pip list\r\ndecorator (4.0.2)\r\nipython (4.0.0)\r\nipython-genutils (0.1.0)\r\nnose (1.3.7)\r\nnumpy (1.9.2)\r\npath.py (7.7.1)\r\npexpect (3.3)\r\npickleshare (0.5)\r\npip (7.1.2)\r\npkgconfig (1.1.0)\r\nreadline (6.2.4.1)\r\nscipy (0.16.0)\r\nsetuptools (18.2)\r\nsimplegeneric (0.8.1)\r\nsix (1.9.0)\r\ntraitlets (4.0.0)\r\n```\r\n\r\n```bash\r\n$ /bin/ls /usr/nld/atlas-3.10.2/lib \r\nlibatlas.a  libcblas.a  libf77blas.a  liblapack.a  libptcblas.a  libptf77blas.a  libsatlas.so  libtatlas.so\r\n```\r\nBy the way, under Python 2.7.9 on the same system with the same setup, this bug does not occur."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/135139781","html_url":"https://github.com/numpy/numpy/issues/6251#issuecomment-135139781","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6251","id":135139781,"user":{"login":"andsor","id":1507695,"avatar_url":"https://avatars.githubusercontent.com/u/1507695?v=3","gravatar_id":"","url":"https://api.github.com/users/andsor","html_url":"https://github.com/andsor","followers_url":"https://api.github.com/users/andsor/followers","following_url":"https://api.github.com/users/andsor/following{/other_user}","gists_url":"https://api.github.com/users/andsor/gists{/gist_id}","starred_url":"https://api.github.com/users/andsor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andsor/subscriptions","organizations_url":"https://api.github.com/users/andsor/orgs","repos_url":"https://api.github.com/users/andsor/repos","events_url":"https://api.github.com/users/andsor/events{/privacy}","received_events_url":"https://api.github.com/users/andsor/received_events","type":"User","site_admin":false},"created_at":"2015-08-26T18:59:37Z","updated_at":"2015-08-26T18:59:37Z","body":"Hey, thanks. So the comparison operation is giving the incorrect results, for example here is the output for ``i == 2``:\r\n```\r\n2\r\n[  0.   0.]\r\n[False  True]\r\n[ True False]\r\n[0]\r\n```"}}