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

Generalization of the value parameter in the unstack function #3066

Closed
sprmnt21 opened this issue Jun 3, 2022 · 2 comments
Closed

Generalization of the value parameter in the unstack function #3066

sprmnt21 opened this issue Jun 3, 2022 · 2 comments

Comments

@sprmnt21
Copy link

sprmnt21 commented Jun 3, 2022

I do not think it is a very felt need, but if it were not too complicated and at risk of unwanted side effects, a generalization of the value parameter could be useful.
Extending it to the case of multiple columns.
A fictional example follows to give an idea of what it might do.

df = DataFrame(x1=rand('a':'d', 100), x2=rand('x':'z', 100),x3=rand('X':'Z', 100),x4=rand('X':'Z', 100))
transform!(df, [:x3,:x4]=>(.==)=>:eq)
udf=unstack(df, :x1,:x2,:eq, valuestransform=x->sum((.!)(x)))


#The extended syntax should allow such an expression to have the same result as above.


_udf=unstack(df, :x1,:x2, [:x3,:x4], valuestransform=(x,y)->sum(x.!=y))_
@bkamins
Copy link
Member

bkamins commented Jun 3, 2022

This is on a to-do list (the design would need to be confirmed) along with #1839. I will keep this open for the future (it will not go into 1.4 release).

@bkamins bkamins added this to the 1.x milestone Jun 3, 2022
@bkamins
Copy link
Member

bkamins commented Dec 5, 2022

I am closing this in favor of #3237 (to have a single place to discuss all related issues)

@bkamins bkamins closed this as completed Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants