-
Notifications
You must be signed in to change notification settings - Fork 370
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
Allow data frame and DataFrameRow to take part in broadcasting #1806
Comments
I agree Having |
This gets complex 😄. Especially as the question is how we want to provide broadcast fusion. I will have to think about it. However, there is one general comment:
This is a delicate point (and I would leave out the decision what to do with |
A note to remember. When we decided to treat Probably still we should treat |
Right. Given what we said at #1804 (comment), it wouldn't be consistent to treat
Indeed, that's another difficult point. Strictly speaking I guess |
This is exactly the problem. And yes - treating a
I think we will not have a problem with this as long as we do not define data frames as iterable. Also currently data frame does not support |
We have the following ways to go (the decision influences #1804, so that PR is on hold now).
Note 1 Whatever is written here does not broadcasting over a single column (which fortunately). This kind of broadcasting is a major use case. If we cannot decide what to do for multiple-column broadcasting the "zero" is option 1. below. Note 2 Everywhere I omit discussion of row selection as this is irrelevant (the behavior is not affected if we take all rows or only a subset of rows, except a single row when a
@nalimilan - this is a summary of the options we discussed. Feel free to edit this post if you wish, so that we do not have a spaghetti discussion on this but keep things in one place. EDIT In summary the major decision is how we treat |
Given that broadcasting is supposed to be tied with indexing, treating data frames as two-dimensional in broadcasting sounds the best option (and the most useful one in practice). So option 2 is probably the way to go, even if it's a bit weird for Though I think we should disallow broadcasting |
OK. I will add then the suupport for |
Currently data frame is not allowed in broadcasting and
DataFrameRow
is collected to a vector.Following the discussion in #1804 we should probably implement custom broadcasting rules for them that would preserve column names if possible.
It is not entirely clear for me what should be the output but I guess this is an initially reasonable approach:
f.(data_frame)
returns aDataFrame
transforming each element usingf
but retaining column names; the question is what should happen if we combine data frames in broadcasting with other data frames or data frame rows or three or higher dimensional objects;f.(::DataFrameRow)
should produce - probably aNamedTuple
, but the problem is thatNamedTuples
are not allowed in broadcasting laterPlease comment if you have any opinion on this.
The text was updated successfully, but these errors were encountered: