Add a way to refer to multiple joined frames' columns
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the chained join and update expression using dt.Frame, dt.update, join, f, and g. Trace how joined columns are exposed during indexing and define the behavior needed for accessing jf2's D column; done means the example updates C to the expected values without a workaround.
Written by the indexing model from the issue text.
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).
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:
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:
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 Dcannot be accessed. I'd like to do something like this:
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.
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 164
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from h2oai/datatable
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deepseek-ai/DeepGEMM-Ascend#49 ·
Maintainers usually reply within 1 day
-
bug needs testing platform:windows topic:buildsystem topic:platforms
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#126110 · 1 comment ·
Maintainers usually reply within 1 day
-
comp-s3queue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ClickHouse/ClickHouse#137649 ·
Maintainers usually reply within 1 day
-
area/docdb kind/enhancement mvu-pg15-pg19 priority/low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yugabyte/yugabyte-db#40355 ·
Maintainers usually reply within 1 day
-
Clear params.inputs in dials.indexPossibly taken @phyy-nx claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
dials/dials#3361 · 1 comment ·
Maintainers usually reply within 1 day