{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/22880","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/22880/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/22880/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/22880/events","html_url":"https://github.com/pandas-dev/pandas/pull/22880","id":365002360,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MDU1OTg5","number":22880,"title":"Use align_method in comp_method_FRAME","user":{"login":"jbrockmendel","id":8078968,"node_id":"MDQ6VXNlcjgwNzg5Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/8078968?v=4","gravatar_id":"","url":"https://api.github.com/users/jbrockmendel","html_url":"https://github.com/jbrockmendel","followers_url":"https://api.github.com/users/jbrockmendel/followers","following_url":"https://api.github.com/users/jbrockmendel/following{/other_user}","gists_url":"https://api.github.com/users/jbrockmendel/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrockmendel/subscriptions","organizations_url":"https://api.github.com/users/jbrockmendel/orgs","repos_url":"https://api.github.com/users/jbrockmendel/repos","events_url":"https://api.github.com/users/jbrockmendel/events{/privacy}","received_events_url":"https://api.github.com/users/jbrockmendel/received_events","type":"User","site_admin":false},"labels":[{"id":47223669,"node_id":"MDU6TGFiZWw0NzIyMzY2OQ==","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Numeric","name":"Numeric","color":"006b75","default":false},{"id":13098779,"node_id":"MDU6TGFiZWwxMzA5ODc3OQ==","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping","name":"Reshaping","color":"02d7e1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":23,"created_at":"2018-09-28T18:53:16Z","updated_at":"2018-10-12T17:31:26Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/22880","html_url":"https://github.com/pandas-dev/pandas/pull/22880","diff_url":"https://github.com/pandas-dev/pandas/pull/22880.diff","patch_url":"https://github.com/pandas-dev/pandas/pull/22880.patch"},"body":"Closes #20090\r\n\r\n<b>update</b> Since #22355 was merged, some of the discussion is out of date.  The bottom line remains unchanged: This PR makes DataFrame _comparison_ ops behave like DataFrame _arithmetic_ ops currently do.  Also fixes some bugs e.g. #20090\r\n<b> end update</b>\r\n\r\nThis is a much nicer alternative to the implementation in #22751.  The problem is that two tests still fail with this implementation.  We need to pin down the design spec more explicitly regardless.\r\n\r\ncore.ops has three functions for defining DataFrame ops: _arith_method_FRAME, _flex_comp_method_FRAME, _comp_method_FRAME.  The first two both call `_align_method_FRAME`, with `_comp_method_FRAME` being the outlier.  This PR just adds that alignment call.\r\n\r\nThe two tests that currently fail:\r\n\r\n```\r\ndf = DataFrame(np.arange(6).reshape((3, 2)))\r\nb_r = np.atleast_2d([2, 2])\r\nl = (2, 2, 2)\r\nexpected = DataFrame([[False, False], [False, True], [True, True]])\r\nresult = df > l   # <-- raises ValueError under this PR because it has the wrong shape\r\nassert_frame_equal(result, expected)\r\n\r\nresult = df > b_r   # <-- raises ValueError under this PR because it has the wrong shape\r\nassert_frame_equal(result, expected)\r\n```\r\n\r\n```\r\ndf = pd.DataFrame(np.arange(6).reshape((3, 2)))\r\nwith pytest.raises(ValueError):  # <-- doesnt raise\r\n           df == (2, 2)\r\n```\r\n\r\nI understand why the behavior tested by the first test makes sense, but don't see the logic behind having `df == (2, 2)` raise (maybe #4576 holds the answer, will look at that more closely)"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/429401666","html_url":"https://github.com/pandas-dev/pandas/pull/22880#issuecomment-429401666","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/22880","id":429401666,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTQwMTY2Ng==","user":{"login":"jorisvandenbossche","id":1020496,"node_id":"MDQ6VXNlcjEwMjA0OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1020496?v=4","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"created_at":"2018-10-12T17:31:26Z","updated_at":"2018-10-12T17:31:26Z","author_association":"MEMBER","body":"> update Since #22355 was merged,\r\n\r\nThat's an open issue, not a merged PR?"}}
{"actor":{"display_login":"jorisvandenbossche"}}