Skip to content

[ENH] Add ability to convert CamelCase to snake_case by default in clean_names #498

Closed
@ericmjl

Description

@ericmjl

Brief Description

clean_names() right now does not convert names from camel case to snake case. I think it should, and in the spirit of being opinionated, it should be enabled by default.

Example API

The current function signature is:

def clean_names(df, strip_underscores, case_type: str = 'lower', ...):

I would propose changing case_type to default to snake, rather than lower.

def clean_names(df, strip_underscores, case_type: str = 'snake', ...):

Notes

Some Googling around reveals the following implementations for CamelCase to snake_case conversion:

If the implementation is copied over from these two sources, I would ensure that the original code is properly referenced with at least a URL pointing to the original in the docstring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions