{"action":"opened","issue":{"url":"https://api.github.com/repos/v0dro/daru/issues/210","repository_url":"https://api.github.com/repos/v0dro/daru","labels_url":"https://api.github.com/repos/v0dro/daru/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/v0dro/daru/issues/210/comments","events_url":"https://api.github.com/repos/v0dro/daru/issues/210/events","html_url":"https://github.com/v0dro/daru/issues/210","id":169549470,"number":210,"title":"Allow 'mask' dataframes and vectors into where clause","user":{"login":"v0dro","id":2629909,"avatar_url":"https://avatars.githubusercontent.com/u/2629909?v=3","gravatar_id":"","url":"https://api.github.com/users/v0dro","html_url":"https://github.com/v0dro","followers_url":"https://api.github.com/users/v0dro/followers","following_url":"https://api.github.com/users/v0dro/following{/other_user}","gists_url":"https://api.github.com/users/v0dro/gists{/gist_id}","starred_url":"https://api.github.com/users/v0dro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v0dro/subscriptions","organizations_url":"https://api.github.com/users/v0dro/orgs","repos_url":"https://api.github.com/users/v0dro/repos","events_url":"https://api.github.com/users/v0dro/events{/privacy}","received_events_url":"https://api.github.com/users/v0dro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-05T07:54:10Z","updated_at":"2016-08-05T07:54:10Z","closed_at":null,"body":"This issue is complimentary to #209 .\r\n\r\nThe `where=` clause will only accept BoolArray as the first argument. However, it should also be able to accept dataframes that contain vector names similar to that of the calling dataframe and make the assignment only where there's a `true` against an index. Something like a 'mask' dataframe.\r\n\r\nFor example, consider this dataframe:\r\n``` ruby\r\ndf  = Daru::DataFrame.new({\r\n  a: [1,2,3,4,5],\r\n  b: [400,500,200,1,5]\r\n})\r\n\r\ndf_mask = Daru::DataFrame.new({\r\n  a: [true, false, false, true, false],\r\n  b: [false, false true, true, false]\r\n})\r\n```\r\n\r\nThe following syntax:\r\n``` ruby\r\ndf.where(df_mask) = -1000\r\n```\r\n\r\n...should yield the following dataframe:\r\n``` ruby\r\nDaru::DataFrame.new({\r\n  a: [-1000,2,3,-1000,5],\r\n  b: [400,500,-1000,-1000,5]\r\n})\r\n```"}}
{"actor":{"display_login":"v0dro"}}