Skip to content
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

How to approach add_nested with mismatched index #42

Closed
dougbrn opened this issue May 2, 2024 · 2 comments
Closed

How to approach add_nested with mismatched index #42

dougbrn opened this issue May 2, 2024 · 2 comments

Comments

@dougbrn
Copy link
Collaborator

dougbrn commented May 2, 2024

add_nested currently works as a left join from the perspective of the base layer, as shown below:

# unmatched nested objects are removed
>>> base = NestedFrame({"a":[1,2,3]}, index=[0,1,2])
>>> nested = NestedFrame({"b":[1,2,3,4]}, index=[0,1,2,3])

>>> base.add_nested(nested, "nested")
	a	nested
0	1	b 0 1
1	2	b 0 2
2	3	b 0 3
# unmatched base rows are kept
>>> base = NestedFrame({"a":[1,2,3]}, index=[0,1,2])
>>> nested = NestedFrame({"b":[1,2,3,4]}, index=[0,1,3,3]) # no match for index=2

>>> base.add_nested(nested, "nested")
	a	nested
0	1	b 0 1
1	2	b 0 2
2	3	None

Is this the best default behavior? Should we add various join options to the output of this operation? For time-domain purposes, I can see value in keeping nested lightcurves even when no object information is present

@dougbrn
Copy link
Collaborator Author

dougbrn commented Jun 26, 2024

This has been implemented on the nested-dask side as a choice that defaults to an outer join, we should follow suit here:
Screen Shot 2024-06-26 at 2 49 03 PM

@hombit
Copy link
Collaborator

hombit commented Jun 27, 2024

Should be fixed when #115 and #116 are fixed

@hombit hombit closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants