dataFrame.column — renameTo()
Description
The renameTo() method of the column object renames the selected column while preserving its values.
Signature
dataFrame.column(sourceColumnName).renameTo(targetColumnName)Arguments
sourceColumnName(string)- The name of the column to rename.
targetColumnName(string)- The new name of the column.
Example
// rename the 'revenue' column of the dataFrame
dataFrame.column('revenue').renameTo('new revenue');