toCamelCase
Renames the columns, previously selected with rename to "camelCase" format.
All delimiters between words are removed, words are capitalized except for the first one. Places underscore between numbers. If the string does not contain any letters or numbers, it remains unchanged.
Returns a DataFrame with updated column names.
This function supports converting names from snake_case, PascalCase, and other delimited formats into a consistent "camelCase" representation.
Examples
// Renames "arrival_date" and "passport-ID" columns to "camelCase"
df.rename("arrival_date", "passport-ID").toCamelCase()
// Renames all numeric columns to "camelCase"
df.rename { colsOf<Number>() }.toCamelCase()Content copied to clipboard
Renaming Examples
"snake_case_name" -> "snakeCaseName"
"PascalCaseName" -> "pascalCaseName"
"kebab-case-name" -> "kebabCaseName"
"UPPER_CASE_NAME" -> "upperCaseName"Content copied to clipboard
For more information: See renameToCamelCase on the documentation website.
Return
a DataFrame with column names converted to "camelCase" format.