Skip to content

Transform a Column #255

@patrikguempel

Description

@patrikguempel

Is your feature request related to a problem?

A Table can already be transformed by calling transform_table or transform_column. It would be nice to have this capability on a Column too.

Desired solution

  • Add a method transform to Column:
class Column(Sequence[_T]):
    def transform(self, transformer: Callable[[_T], _O]) -> Column[_O]:
        ...
  • Map transformer over the values of the column and collect the results
  • As usual, it should not change the receiving instance but return a new Column.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

The apply function of pandas could be useful here.

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