How could I convert all column names in a datafram...
# datascience
h
How could I convert all column names in a dataframe to snake_case?
i
If you have your function
toSnakeCase()
that converts any String to snake case, then it can be done this way:
Copy code
df.rename { all() }.into { it.name.toSnakeCase() }
h
i
Yes, it's easy but it depends on your particular case - you may initially have CamelCase, space separated words or anything else)
712 Views