Replies: 2 comments 3 replies
-
In the earlier versions (<v0.4), the implementation was easy. That's because each group is separated and applied with the defined functions so that we don't need to consider the groupedness. Here is a rough illustration of the previous architecture:
You can see that the vectorized function only needs to handle the data in each group, and However, this causes performance issues. See: That's because this way, we are unable to take the advantage of something like That's why now we have a new architecture:
This way, we can handle everything inside the function, which enables us to apply some strategies like But it doesn't mean we have to handle every detail inside the function. We do have some helper functions to achieve the "unawareness of the groupedness". The helper functions are defined in You can find the following example to define a function with "unawareness of the groupedness": datar/datar/base/arithmetic.py Lines 415 to 427 in cd2595b
We can do it with some simple and common functions. However, they are way more complicated cases, and the result is from none of the aggregation, transformation or apply. In such a case, we have to handle the groupedness by ourselves inside the function since It looks like |
Beta Was this translation helpful? Give feedback.
-
Forgive my naivety, by could something like providing following decorator work together with
|
Beta Was this translation helpful? Give feedback.
-
Older versions of datar used pipda with a fairly easy to use way of creating vectorized functions:
From what I gather from the current methodology (see in the current
weighted_mean()
), there are multiple functions that needed to handle grouped/non-grouped versions of the dataframe.What would be great if there if there an approach that allows me to be "dplyr-ish" and just have a vectorized function that is unaware of groupedness, similar to how functions used inside of dplyr functions can work over grouped and non-grouped tibbles.
Beta Was this translation helpful? Give feedback.
All reactions