-
Notifications
You must be signed in to change notification settings - Fork 397
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersp2 (backlog)Nice to have featuresNice to have features
Description
Is your feature request related to a problem? Please describe.
Sometimes I have some columns or other text that is in one casing, such as camelCase and I want to apply a transformation to convert that to another casing, such as snake_case
Describe the solution you'd like
df = daft.from_pydict({'text': ['helloWorld', 'hello-world', 'HelloWorld']})
df.with_columns(
camel_case = col('text').str.to_camel_case(),
upper_camel_case = col('text').str.to_upper_camel_case(),
snake_case = col('text').str.to_snake_case(),
upper_snake_case = col('text').str.to_upper_snake_case(),
kebab_case = col('text').str.to_kebab_case(),
upper_kebab_case = col('text').str.to_upper_kebab_case(),
)
df = daft.from_pydict({'text': ['helloWorld', 'hello-world', 'HelloWorld']})
df.with_columns(
camel_case = col('text').str.to_camel_case(),
upper_camel_case = col('text').str.to_upper_camel_case(),
snake_case = col('text').str.to_snake_case(),
upper_snake_case = col('text').str.to_upper_snake_case(),
kebab_case = col('text').str.to_kebab_case(),
upper_kebab_case = col('text').str.to_upper_kebab_case(),
title_case = col('text').str.to_title_case(),
)
# expected
expected = {
'camel_case': ['helloWorld', 'helloWorld', 'helloWorld'],
'upper_camel_case': ['HelloWorld', 'HelloWorld', 'HelloWorld'],
'snake_case': ['hello_world', 'hello_world', 'hello_world'],
'upper_snake_case': ['HELLO_WORLD', 'HELLO_WORLD', 'HELLO_WORLD'],
'kebab_case': ['hello-world', 'hello-world', 'hello-world'],
'upper_kebab_case': ['HELLO-WORLD', 'HELLO-WORLD', 'HELLO-WORLD'],
'title_case': ['Hello World', 'Hello World', 'Hello World']
}Describe alternatives you've considered
udfs
Additional context
heck seems like a highly popular library that can do this
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersp2 (backlog)Nice to have featuresNice to have features