Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add keyword by or argument function f to set operations such as intersect #33274

Open
johnnychen94 opened this issue Sep 16, 2019 · 0 comments
Open
Labels
domain:collections Data structures holding multiple items, e.g. sets kind:feature Indicates new feature / enhancement requests

Comments

@johnnychen94
Copy link
Sponsor Member

johnnychen94 commented Sep 16, 2019

The following is a demo for what I'm expecting: it returns pixels that have the same position regardless of color.

struct Pixel
    color
    pos
end

img = rand(T, 4, 4)
pixels = Pixel.(img, CartesianIndices(img))

intersect(pixels[1:3, 1:3], pixels[2:3, 2:4]; by=p->p.pos) # keyword
intersect(p->p.pos, pixels[1:3, 1:3], pixels[2:3, 2:4]) # function

Not very sure how broadly this is useful to other fields.

@StefanKarpinski StefanKarpinski added kind:feature Indicates new feature / enhancement requests domain:collections Data structures holding multiple items, e.g. sets labels Sep 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:collections Data structures holding multiple items, e.g. sets kind:feature Indicates new feature / enhancement requests
Projects
None yet
Development

No branches or pull requests

2 participants