{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/29749","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/29749/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/29749/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/29749/events","html_url":"https://github.com/JuliaLang/julia/pull/29749","id":372277317,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NTE2ODI1","number":29749,"title":"Row and Column Iterator for Matrices","user":{"login":"arnavs","id":5009477,"node_id":"MDQ6VXNlcjUwMDk0Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/5009477?v=4","gravatar_id":"","url":"https://api.github.com/users/arnavs","html_url":"https://github.com/arnavs","followers_url":"https://api.github.com/users/arnavs/followers","following_url":"https://api.github.com/users/arnavs/following{/other_user}","gists_url":"https://api.github.com/users/arnavs/gists{/gist_id}","starred_url":"https://api.github.com/users/arnavs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arnavs/subscriptions","organizations_url":"https://api.github.com/users/arnavs/orgs","repos_url":"https://api.github.com/users/arnavs/repos","events_url":"https://api.github.com/users/arnavs/events{/privacy}","received_events_url":"https://api.github.com/users/arnavs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-10-21T04:07:45Z","updated_at":"2018-10-22T04:19:34Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/29749","html_url":"https://github.com/JuliaLang/julia/pull/29749","diff_url":"https://github.com/JuliaLang/julia/pull/29749.diff","patch_url":"https://github.com/JuliaLang/julia/pull/29749.patch"},"body":"Talked in Slack about creating `eachrow(m::Matrix)` and `eachcolumn(m::Matrix)` which return an iterator over the rows and columns of `M`. Here's a stab at it. "},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/431737454","html_url":"https://github.com/JuliaLang/julia/pull/29749#issuecomment-431737454","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/29749","id":431737454,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTczNzQ1NA==","user":{"login":"andyferris","id":2974526,"node_id":"MDQ6VXNlcjI5NzQ1MjY=","avatar_url":"https://avatars3.githubusercontent.com/u/2974526?v=4","gravatar_id":"","url":"https://api.github.com/users/andyferris","html_url":"https://github.com/andyferris","followers_url":"https://api.github.com/users/andyferris/followers","following_url":"https://api.github.com/users/andyferris/following{/other_user}","gists_url":"https://api.github.com/users/andyferris/gists{/gist_id}","starred_url":"https://api.github.com/users/andyferris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyferris/subscriptions","organizations_url":"https://api.github.com/users/andyferris/orgs","repos_url":"https://api.github.com/users/andyferris/repos","events_url":"https://api.github.com/users/andyferris/events{/privacy}","received_events_url":"https://api.github.com/users/andyferris/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T04:19:34Z","updated_at":"2018-10-22T04:19:34Z","author_association":"CONTRIBUTOR","body":"Cool, nice, I was hoping we would implement something like this soon!\r\n\r\nThis one is a little close to my heart. For this functionality, I was hoping we could be slightly more generic - by being able to slice up arrays of any dimensionality by any one (or more) dimension.\r\n\r\nAdditionally, since arrays naturally support random-access, it's also possible to turn the \"iterator\"s into a fully-fledged `AbstractArray`s in their own right. That is, `eachrow` of a matrix could return a nested vector of vectors. This would let users interact with the result in ways beyond a simple `for` loop. For example, the presence of the indices makes it easier to match up multiple containers which share indices along certain dimensions. Finally, different array types may have their own implementations of `map`, `reduce` and so-on which is quite different to a sequential `for` loop over all elements (consider for example doing something in parallel with the rows of a `DMatrix` from DistributedArrays).\r\n\r\nAnyway, because I've been interested in this for a little while, I implemented such a nested array dimension splitting in a package called [SplitApplyCombine](https://github.com/JuliaData/SplitApplyCombine.jl) under the functions `splitdims` and `splitdimsview` (the latter being lazy). My intention here was always to develop these in a package and hopefully move these to `Base` through a PR here for Julia 1.x. (It should be noted that I don't *particularly* like my function names, but they are at least descriptive placeholders for now).\r\n\r\nIf I may be slightly philosophical - in my view, it seems more productive and flexible to let users put together different \"split\", \"apply\" and \"combine\" strategies like lego bricks, rather than to rely on increasingly complex functions like `mapslices` to do a split-apply-combine strategy all in one step, which is why I'm advocating for this in general, and excited by this PR in particular.\r\n\r\nAnyway, if @arnavs and the community are at all interested, I'd be happy to help expand the functionality here to work on arbitrary dimensions and return a fully-fledged `AbstractArray`."}}
{"actor":{"display_login":"andyferris"}}