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

Use repr instead of str for printing column and index #42

Open
richardlin047 opened this issue Apr 17, 2021 · 0 comments
Open

Use repr instead of str for printing column and index #42

richardlin047 opened this issue Apr 17, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@richardlin047
Copy link
Collaborator

The history cell will output code that might error if it uses columns with number names because of how we format the variable names.

The sort column code snippet is currently:

df.sort_values('{self._sort_field}', ascending={self._sort_ascending}, inplace=True)

This assumes the column name is always a string. To allow columns with numbers as the name, it should be:

df.sort_values({repr(self._sort_field)}, ascending={self._sort_ascending}, inplace=True)

This should be fixed for wherever there is a use of '{variable}' for columns or rows.

@richardlin047 richardlin047 added the bug Something isn't working label Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant