{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/13006","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/13006/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/13006/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/13006/events","html_url":"https://github.com/pydata/pandas/issues/13006","id":151268829,"number":13006,"title":"BUG: Type error when comparing numpy scalar to pandas series","user":{"login":"rocurley","id":1490832,"avatar_url":"https://avatars.githubusercontent.com/u/1490832?v=3","gravatar_id":"","url":"https://api.github.com/users/rocurley","html_url":"https://github.com/rocurley","followers_url":"https://api.github.com/users/rocurley/followers","following_url":"https://api.github.com/users/rocurley/following{/other_user}","gists_url":"https://api.github.com/users/rocurley/gists{/gist_id}","starred_url":"https://api.github.com/users/rocurley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocurley/subscriptions","organizations_url":"https://api.github.com/users/rocurley/orgs","repos_url":"https://api.github.com/users/rocurley/repos","events_url":"https://api.github.com/users/rocurley/events{/privacy}","received_events_url":"https://api.github.com/users/rocurley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Difficulty%20Novice","name":"Difficulty Novice","color":"fbca04"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Dtypes","name":"Dtypes","color":"e102d8"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Effort%20Low","name":"Effort Low","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/32","html_url":"https://github.com/pydata/pandas/milestones/Next%20Major%20Release","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/32/labels","id":933188,"number":32,"title":"Next Major Release","description":"after 0.18.0 of course","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"open_issues":948,"closed_issues":132,"state":"open","created_at":"2015-01-13T10:53:19Z","updated_at":"2016-04-27T00:20:42Z","due_on":"2016-08-31T04:00:00Z","closed_at":null},"comments":2,"created_at":"2016-04-27T00:15:47Z","updated_at":"2016-04-27T00:40:58Z","closed_at":null,"body":"Hi,\r\n\r\nI'm getting strange results when comparing a numpy float to a pandas series. It seems to think that the numpy float is some sort of array...\r\n\r\n```python\r\nimport numpy as np\r\nimport pandas as pd\r\nnp.float64(0) < pd.Series([1,2,3],dtype=np.float64)\r\n```\r\n#### Expected Output\r\n```\r\n0    True\r\n1    True\r\n2    True\r\ndtype: bool\r\n```\r\n#### Actual Output\r\n```\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-3-0803a1472416> in <module>()\r\n      1 import numpy as np\r\n      2 import pandas as pd\r\n----> 3 np.float64(0) < pd.Series([1,2,3],dtype=np.float64)\r\n        global np.float64 = <type 'numpy.float64'>\r\n        global pd.Series = <class 'pandas.core.series.Series'>\r\n        global dtype = undefined\r\n\r\n/usr/local/lib/python2.7/dist-packages/pandas/core/ops.pyc in wrapper(self=0    1.0\r\n1    2.0\r\n2    3.0\r\ndtype: float64, other=array(0.0), axis=None)\r\n    737             return NotImplemented\r\n    738         elif isinstance(other, (np.ndarray, pd.Index)):\r\n--> 739             if len(self) != len(other):\r\n        global len = undefined\r\n        self = 0    1.0\r\n1    2.0\r\n2    3.0\r\ndtype: float64\r\n        other = array(0.0)\r\n    740                 raise ValueError('Lengths must match to compare')\r\n    741             return self._constructor(na_op(self.values, np.asarray(other)),\r\n\r\nTypeError: len() of unsized object\r\n\r\n\r\n```\r\n#### output of ``pd.show_versions()``\r\n```\r\nINSTALLED VERSIONS\r\n------------------\r\ncommit: None\r\npython: 2.7.6.final.0\r\npython-bits: 64\r\nOS: Linux\r\nOS-release: 4.3.0-040300-generic\r\nmachine: x86_64\r\nprocessor: x86_64\r\nbyteorder: little\r\nLC_ALL: None\r\nLANG: en_US.UTF-8\r\n\r\npandas: 0.18.0\r\nnose: None\r\npip: 8.1.1\r\nsetuptools: 20.3.1\r\nCython: None\r\nnumpy: 1.11.0\r\nscipy: 0.17.0\r\nstatsmodels: None\r\nxarray: None\r\nIPython: 4.0.0\r\nsphinx: None\r\npatsy: None\r\ndateutil: 2.5.3\r\npytz: 2015.7\r\nblosc: None\r\nbottleneck: None\r\ntables: None\r\nnumexpr: None\r\nmatplotlib: 1.5.0\r\nopenpyxl: None\r\nxlrd: None\r\nxlwt: None\r\nxlsxwriter: None\r\nlxml: None\r\nbs4: None\r\nhtml5lib: None\r\nhttplib2: 0.8\r\napiclient: None\r\nsqlalchemy: None\r\npymysql: None\r\npsycopg2: None\r\njinja2: 2.8\r\nboto: None\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/214930246","html_url":"https://github.com/pydata/pandas/issues/13006#issuecomment-214930246","issue_url":"https://api.github.com/repos/pydata/pandas/issues/13006","id":214930246,"user":{"login":"rocurley","id":1490832,"avatar_url":"https://avatars.githubusercontent.com/u/1490832?v=3","gravatar_id":"","url":"https://api.github.com/users/rocurley","html_url":"https://github.com/rocurley","followers_url":"https://api.github.com/users/rocurley/followers","following_url":"https://api.github.com/users/rocurley/following{/other_user}","gists_url":"https://api.github.com/users/rocurley/gists{/gist_id}","starred_url":"https://api.github.com/users/rocurley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rocurley/subscriptions","organizations_url":"https://api.github.com/users/rocurley/orgs","repos_url":"https://api.github.com/users/rocurley/repos","events_url":"https://api.github.com/users/rocurley/events{/privacy}","received_events_url":"https://api.github.com/users/rocurley/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T00:40:58Z","updated_at":"2016-04-27T00:40:58Z","body":"A slightly more realistic example would be:\r\n```python\r\n(np.array([0,1,2])[0]) < pd.Series([0,1,2])\r\n```"}}