vDataFrame[].rename¶
In [ ]:
vDataFrame[].rename(new_name: str)
Renames the vcolumn by dropping the current vcolumn and creating a copy with the specified name.
⚠ Warning: SQL code generation will be slower if the vDataFrame has been transformed multiple times, so it's better practice to use this method when first preparing your data.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
new_name | str | ❌ | The new vcolumn alias. |
In [62]:
from verticapy.datasets import load_titanic
titanic = load_titanic()
display(titanic["sex"])
In [63]:
titanic["sex"].rename("gender")
display(titanic["gender"])
See Also¶
| vDataFrame[].add_copy | Creates a copy of the vcolumn. |
