Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Properly pythonify columns names starting with numerals #4

Open
ljleppan opened this issue Jul 20, 2017 · 0 comments
Open

ENH: Properly pythonify columns names starting with numerals #4

ljleppan opened this issue Jul 20, 2017 · 0 comments

Comments

@ljleppan
Copy link
Owner

While the utility function pythonify_column_names(df) introduced in commit b49085b makes a good initial effort for translating all column names to valid python identifiers, column names starting with numerals remain invalid.

As valid python identifier column names are effectively required to properly use f.ex. the HDF5 format with Pandas, these column names, too, should be made valid.

I believe a good initial solution is to add an argument to pythonify_column_names(df), so that the new signature is pythonify_column_names(df, number_prefix=None). The new argument number_prefix would then be prepended to all column names starting with a number, provided that it is not None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant