rename_columns

The rename_columns method creates a new table with specified columns renamed.

Syntax

Parameters

ParameterTypeDescription
colsUnion[str, Sequence[str]]

Columns that will be renamed in the new table.

  • "X = Y" will rename source column Y to X.

Returns

A new table that renames the specified columns.

Examples

The following example renames columns A and C: