Skip to content

Add tooling to embed a base column into a nested column #200

@hombit

Description

@hombit

Feature request

It would be nice if we have a way to convert a base column to a field of a nested column, so the values are repeated for each row. Possible interface:

ndf = generate_data(100, 10)
ndf.add_repeated_nested(ndf["a"], name="nested.a")
# Now ndf["nested"][0] has "a" column and all the values are equal to ndf["a"][0]
ndf.add_repeated_nested("b", to="nested")
# The same, but by base column name, so ndf["nested.b"] is np.repeat(ndf["b"], list_lengths)

It would also require adding lower-level implementations to the accessor and the extension array.

The example use-case: moving band information in ZTF DR23 catalog to light-curves, so we can merge multiple light curves with different passbands later.

Before submitting
Please check the following:

  • I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
  • I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
  • If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions