Add a way to refer to multiple joined frames' columns
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 164
- Avg merge
- 7h 31m
- Merged PRs (30d)
- 1
Description
I want to index `df` on column `A` with `jf` and then join with `jf2` to update column `C` with `jf2`'s column `D` (also naming it `C` wouldn't help here).
```Python
from datatable import dt, f, join, g
df = dt.Frame("""A B C
a e 0
b e 0
b f 0
c f 0
d f 2""")
jf = dt.Frame("""A
b
c""")
jf.key = "A"
jf2 = dt.Frame("""B D
e 3
f 4""")
jf2.key = "B"
```
So after updating `df` would be:
```Python
df_desired = dt.Frame("""A B C
a e 0
b e 3
b f 4
c f 4
d f 1""")
```
Joining works perfectly:
```Python
df[g[0] != None, :, join(jf), join(jf2)]
# | A B C D
# | str32 str32 int32 int32
# -- + ----- ----- ----- -----
# 0 | b e 0 3
# 1 | b f 0 4
# 2 | c f 0 4
# [3 rows x 4 columns]
```
But I can't update in the same step because column `D`cannot be accessed. I'd like to do something like this:
```Python
df[g[0] != None, dt.update(C=g["D"]), join(jf), join(jf2)]
# datatable.exceptions.KeyError: Column D does not exist in the Frame; did you mean A?
```
The columns of `df` are in `f` and the columns of `jf` are in `g`, but the columns of `jf2` cannot be accessed in the `j`-statement.
While this is a feature request, I'd also appreciate good ideas for workarounds.
Contributor guide
Assessment
This issue has not been assessed yet.