{"action":"closed","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/19992","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/19992/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/19992/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/19992/events","html_url":"https://github.com/pandas-dev/pandas/issues/19992","id":302261375,"node_id":"MDU6SXNzdWUzMDIyNjEzNzU=","number":19992,"title":"BUG: clip with a list-like threshold with a nan is broken","user":{"login":"jreback","id":953992,"node_id":"MDQ6VXNlcjk1Mzk5Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/953992?v=4","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},"labels":[{"id":76811,"node_id":"MDU6TGFiZWw3NjgxMQ==","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":195647922,"node_id":"MDU6TGFiZWwxOTU2NDc5MjI=","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Difficulty%20Intermediate","name":"Difficulty Intermediate","color":"fbca04","default":false},{"id":195648017,"node_id":"MDU6TGFiZWwxOTU2NDgwMTc=","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Effort%20Medium","name":"Effort Medium","color":"006b75","default":false},{"id":2822342,"node_id":"MDU6TGFiZWwyODIyMzQy","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data","name":"Missing-data","color":"d7e102","default":false},{"id":47223669,"node_id":"MDU6TGFiZWw0NzIyMzY2OQ==","url":"https://api.github.com/repos/pandas-dev/pandas/labels/Numeric","name":"Numeric","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/pandas-dev/pandas/milestones/58","html_url":"https://github.com/pandas-dev/pandas/milestone/58","labels_url":"https://api.github.com/repos/pandas-dev/pandas/milestones/58/labels","id":3452609,"node_id":"MDk6TWlsZXN0b25lMzQ1MjYwOQ==","number":58,"title":"0.23.4","description":"on-merge: backport to 0.23.x","creator":{"login":"jreback","id":953992,"node_id":"MDQ6VXNlcjk1Mzk5Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/953992?v=4","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":8,"closed_issues":15,"state":"open","created_at":"2018-06-26T11:54:44Z","updated_at":"2018-08-02T10:06:42Z","due_on":"2018-08-03T07:00:00Z","closed_at":null},"comments":1,"created_at":"2018-03-05T11:17:16Z","updated_at":"2018-08-02T10:06:42Z","closed_at":"2018-08-02T10:06:42Z","author_association":"CONTRIBUTOR","body":"xref #19976\r\n\r\n``.clip`` is basically a single or double signed where, where there is a ``nan`` present we just drop the bound entirely which is not correct. A fix for this would also fix #19976. So [31] should yield [30], however for scalars we ignore the nans, so maybe could do that here.\r\n```\r\nIn [26]: s = pd.Series([1,2,3])\r\n\r\nIn [27]: s\r\nOut[27]: \r\n0    1\r\n1    2\r\n2    3\r\ndtype: int64\r\n\r\nIn [28]: s.where(s>4,4)\r\nOut[28]: \r\n0    4\r\n1    4\r\n2    4\r\ndtype: int64\r\n\r\nIn [29]: s.clip(4)\r\nOut[29]: \r\n0    4\r\n1    4\r\n2    4\r\ndtype: int64\r\n\r\n# broken\r\nIn [30]: s.where(s>[0,4,np.nan],[0,4,np.nan])\r\nOut[30]: \r\n0    1.0\r\n1    4.0\r\n2    NaN\r\ndtype: float64\r\n\r\nIn [31]: s.clip([0,4,np.nan])\r\nOut[31]: \r\n0    1\r\n1    2\r\n2    3\r\ndtype: int64\r\n\r\n# ok\r\nIn [2]: s.where(s>[0,4,4],[0,4,4])\r\nOut[2]: \r\n0    1\r\n1    4\r\n2    4\r\ndtype: int64\r\n\r\nIn [3]: s.clip([0,4,4])\r\nOut[3]: \r\n0    1\r\n1    4\r\n2    4\r\ndtype: int64\r\n```"}}
{"actor":{"display_login":"jreback"}}