I failed this audit, which is kind of ridiculous. I voted to close the question, because it:
- really belongs on Programmers or Code Review, not Stack Overflow;
- is broad;
- is multi-part;
- doesn't describe a specific problem encountered by the user with specific code.
Problematic parts of the question:
What is pythonic way to do dt[,y:=myfun(x),by=list(a,b,c)] in R?
The first question, which asks for opinion-based code review:
Although the logic is quite clear, I am not 100% happy with it. Is there any better approach?
A vague tool recommendation/evaluation request, reflecting minimal effort or knowledge:
I am not very familiar with pandas. Does it help in such case?
And a "side question" which really belongs on Programmers or Code Review:
Side question: is there a category that my problem belongs to? aggregation? partition? window? This pattern happens so frequently in data analysis, there must be an existing name for it.
The OP provided code in both R and Python, true, but doesn't have a problem with that code; he just wanted a review and analysis of it. This should be a straightforward close, for any number of reasons.