Skip to content

Enhance replace_column to accept a list of new columns #301

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Currently, Table.replace_column can only be use to replace a column by one new column. It would be nice to also replace a column with multiple other columns, e.g. for the OneHotEncoder.

Desired solution

replace_column should accept a list of new_columns (instead of the original new_column parameter) and replace the original column with the new columns.

All new columns should be inserted at the position of the old column. New columns should be ordered as defined in the list.

Example:

col_1 col_2 col_3
1 3 5
2 4 6

replace_column("col_2", [Column("col_a", [7, 8]), Column("col_b", [9, 0])])

col_1 col_a col_b col_3
1 7 9 5
2 8 0 6

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions