-
Notifications
You must be signed in to change notification settings - Fork 157
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
Combination of range() and count() inside update() leads to TypeError #2892
Comments
Thanks Peter for the question. Unfortunately, I can't think of a way to implement what you're asking -- it may require creating a new function for this task. |
I've checked some other packages, and here's how they do it:
|
Thank you @st-pasha for your explanation very much. I have a way to get the desired output, however the solution isn't elegant at all. Anyway here it is:
|
Yeah, there isn't any clean way without implementing a function. There was a question about this on SO, with a hack |
@st-pasha in terms of API design for something like this, I would suggest maybe one function that can be appended sort of to existing functions, similar to what is available in numpy with Something like Not sure if it makes sense or is doable; it just might help to not have so many functions, while still providing the functionality. Another option would be the user defined function suggested in #1960. That would allow users make use of functions in numpy (which are quite fast and written in C) or other libraries. |
In the simplest case when there are no groups, |
I want to take a stab at this, I am thinking of first implementing a cumsum (which is needed to do the cumcount). |
my knowledge of C++ shows through this; I'll unassign myself; hopefully someone else can pick this up |
this should be resolved by #3279 |
Hi there I want to enumerate the rows in each group.
The last line of code leads to the following error:
Is there a way fix or circumvent this error to get the desired output (only column 'c' is of importance)?:
(I asked the same on SO here: https://stackoverflow.com/questions/66585631/python-datatable-assign-new-column-by-group-to-enumerate-elements)
Thank you for your help :)
The text was updated successfully, but these errors were encountered: